Skip to content

darmingzhao/pixel-art-filter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Pixel Art Filter

Pixel Art Filter is an image filter that pixelates PNG images using a lossy image compression algorithm, written in C++ using clang and LodePNG.

functionality1

functionality2

Prerequisites

To run this project, after cloning it:

Add LodePNG

LodePNG is used to encode and deocde PNG images:

Clang

Clang is used to compile the project:

  • Installing clang on a local machine is different depending on the OS
  • A tutorial can be found online

Deployment

To compile the project, use the command:

make

And once that is finished, run the project using:

./paf

Once this is completed the output will be in the images/ folder.

You can also remove the compiler output files by running the command:

make clean

##Create different effects To add your own images, add PNG files to the images/ folder.

Go to main.cpp and modify the parameters:

origImg1.readFromFile("images/starry-night.png");
origImg2.readFromFile("images/mona-lisa.png");
origImg3.readFromFile("images/hokusai.png");

To play with the pixelation effect, modify the parameters:

t1.prune(0.99, 8500);
t2.prune(0.99, 8500);
t3.prune(0.95, 8500);

Finally, to change the output image names, modify the parameters:

pic1.writeToFile("images/output-starry-night.png");
pic2.writeToFile("images/output-mona-lisa.png");
pic3.writeToFile("images/output-hokusai.png");

About

Image filter that pixelates PNG images using a lossy image compression algorithm

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published