DEV Community

dimaland1
dimaland1

Posted on

Creating Pixel Art with Python and PIL Library

Introduction

Pixel art is a digital art form where images are created at the pixel level. In this article, I'm going to show you how I used Python and the PIL (Python Imaging Library) to transform images into pixel art using a predefined color palette.

Concept

The project involves taking an input image, resizing it to fit a 100x100 pixel grid while maintaining its aspect ratio, and then applying a custom color palette. The result is a colorful pixel art-style image and another in black and white with numbers corresponding to the colors in the palette.

Technology Used

  • Python 3: A powerful and versatile programming language.
  • PIL (Python Imaging Library): An image processing library for Python.

Results

Original image

Image pixelized with color

Blank image pixelized

Conclusion

It was Fun :)

github link : https://github.com/dimaland1/PixelArtGenerator

Top comments (1)

Collapse
 
sreno77 profile image
Scott Reno

You might consider an English translation the the github page

👋 Kindness is contagious

DEV is better (more customized, reading settings like dark mode etc) when you're signed in!

Okay