Git Product home page Git Product logo

png-reindexing's Introduction

PNG-reindexing

PNG reindexing a university project for the course Multimedia.

This project consist into implement this concept: A Fast Palette Reordering Technique Based on GPU-Optimized Genetic Algorithms

This project use AntColony algorithm based on this implementation.

You can try this project with the Telegram Bot PNG-reindexer-bot, just open @png_reindexer_bot with Telegram and send a picture.

Requirements

To run this project you need Python3 and the following packages:

  • pypng
  • numpy
  • scipy
  • image

You can install the packages dependencies through:

$ pip3 install -r requirements.txt

Use just "pip" if you have python3 as default instead of python2.

Usage

This project provides the following commands:

$ python3 main.py -r

The -r (run) parameter generate a new image img1.png of 8x8 pixels with random palette and colors and img2.png with a ordered palette.

$ python3 main.py -i path/file_name.png

The -i (input) parameter get a png image as input and generate the same image as img2.png with a new palette ordered and with the reindexed colors.

If the picture has more than 256 colors, it can't create a palette following the PNG standard, so, optionally it can reduce the colors of the image to 256 with the parameter -f (force).

$ python3 main.py -i path/file_name.png -f

The -l (log) parameter is optional, if used it generates a file palette_stats.txt that show the pixels indexed, palette and the best order of palette (about old unordered palette and new image with ordered palette). Is recommended to use this parameter only with small images.

Credits

png-reindexing's People

Stargazers

 avatar

Watchers

 avatar  avatar  avatar

Forkers

oliwan

png-reindexing's Issues

Is this effective?

Hi, I've been researching PNG palette sorting techniques and came across your project here. Can I ask what your conclusions from this are? I tried running it on the included sample image and a couple of others but the output compressed worse than a typical luminance sort.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.