Giter Club home page Giter Club logo

aestheticvoyager / dither-filter Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 3 KB

This repository contains Python code implementing two popular dithering algorithms, Floyd-Steinberg and Atkinson, using the Numba library for performance optimization. These algorithms are commonly used for reducing the color palette of images while preserving visual quality.

Home Page: https://aestheticvoyager.github.io/aesvoy/posts/dither/

Python 100.00%
atkinson dither dithering-algorithms floyd-steinberg image-processing

dither-filter's Introduction

This repository contains Python code implementing two popular dithering algorithms, Floyd-Steinberg and Atkinson, using the Numba library for performance optimization. These algorithms are commonly used for reducing the color palette of images while preserving visual quality.

Dithering Algorithms

1. Floyd-Steinberg Dithering

  • Developed by Robert W. Floyd and Louis Steinberg in 1976.
  • Distributes quantization errors to neighboring pixels in a specific pattern.
  • Produces sharp images with noticeable noise.

2. Atkinson Dithering

  • Developed by Bill Atkinson in 1982.
  • Similar to Floyd-Steinberg but distributes errors differently.
  • Produces smoother images with less visible noise.

Dependencies

  • Python 3.x
  • NumPy
  • Numba
  • PIL (Python Imaging Library)

Usage

  1. Ensure you have Python installed on your system.
  2. Install the required dependencies using pip:
pip install numpy numba pillow
  1. Clone this repository to your local machine.
  2. Place the image file (e.g., test.JPG) you want to process in the same directory as the Python script.
  3. Run the script dithering.py:
python dithering.py
  1. The processed images (floyd_steinberg.jpg and atkinson.jpg) will be saved in the same directory as the input image.

Customization

  • You can adjust parameters or experiment with different images to observe varying results.
  • Feel free to modify the code to suit your specific requirements or integrate it into your projects.

License

This project is licensed under the MIT License.

dither-filter's People

Contributors

aestheticvoyager avatar

Watchers

 avatar

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.