Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/tfuxu/Halftone
Give your images that pixel art-like style
https://github.com/tfuxu/Halftone
dithering graphics gtk gtk4 libadwaita python
Last synced: 24 days ago
JSON representation
Give your images that pixel art-like style
- Host: GitHub
- URL: https://github.com/tfuxu/Halftone
- Owner: tfuxu
- License: gpl-3.0
- Created: 2023-04-29T16:49:25.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-10-28T13:40:37.000Z (about 1 month ago)
- Last Synced: 2024-11-07T14:23:04.743Z (about 1 month ago)
- Topics: dithering, graphics, gtk, gtk4, libadwaita, python
- Language: Python
- Homepage:
- Size: 4.01 MB
- Stars: 102
- Watchers: 2
- Forks: 16
- Open Issues: 14
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: COPYING
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
- awesome-gtk - Halftone - Image to pixel art converter `#python` `#gtk4` `#libadwaita`. (Graphics / ASCII/Pixel Art)
README
Halftone
========Give your images a pixel art-like style and reduce the file size in the process with Halftone.
![halftone-1](data/screenshots/halftone-1.png)
## What is Halftone?
Halftone is a simple Libadwaita app for lossy image compression using quantization and dithering techniques.## Why would I use it?
Because it's fun! And it can also significantly reduce image size.What is that dithering?
Dithering is a technique used by old systems with a limited color range to more accurately display graphics containing higher amount of colors than what the device can handle. It was commonly used in early Macintosh computers, Nintendo Game Boy and many other systems from the 80s and 90s.##### Wanna learn more about how dithering works?
Check out [this↗](https://surma.dev/things/ditherpunk/) article which nicely explains how dithering argorithms works (warning, math!) and shows most popular dithering algorithms in action.## Features:
- **Three different dither algorithms:**
You can choose between the classic Floyd-Steinberg algorithm, interesting Riemersma and Bayer (_a.k.a_ ordered) dither known from the Game Boys.
- **Live preview:**
Check out how your image will look like in real time with live preview feature.
- **Convert to many formats:**
In addition to dithering, you can convert your images to different formats to save up some space on disk.
- **It's just that simple.**
Everything is as simple as possible, so that you could start dithering your images as soon as you're done installing the app.## How to install Halftone
You can install Halftone in many ways, here are some listed:**1. Official Flatpak package:**
**2. Snap package / Alternative package distributions:**
> [!WARNING]
> Although some of the methods listed here may be maintained by the Halftone maintainers, these methods **are not** officially supported and issues related to packaging in them should be reported outside this project's bug tracker.Or get in from your distribution's package manager:
**3. Install from source:**
If you don't find any other options appealing to you, then you can always compile code on your machine from source and install it that way. For more information, check out [How to build?](#how-to-build) section.
## How can I contribute?
Thanks for asking! Just for you, I've created this list of things you need to do if you want to contribute to Halftone:
1. Read [Code of Conduct](CODE_OF_CONDUCT.md)
2. Fork this repository: https://github.com/tfuxu/Halftone/fork
3. Clone your fork: `git clone https://github.com/👁️you👁️/Halftone.git`
4. Create a local branch with your changes: `git checkout -b new-thingies`
5. When changing stuff in Python, try to follow [PEP8](https://pep8.org/)
6. Commit your changes: `git commit`
7. Push the changes to fork: `git push origin new-thingies`
8. Create a new pull request## How to build?
### GNOME Builder:
This is the easiest way of building Halftone if you want to build it as a Flatpak package. Highly recommended, but probably not for everyone, as GNOME Builder and Flatpak can be quite resource hungry.1. Download [GNOME Builder](https://flathub.org/apps/details/org.gnome.Builder).
2. In Builder, click the _Clone Repository_ button at the bottom, using `https://github.com/tfuxu/Halftone.git` as the URL.
3. Click the _Build_ button at the top once the project is loaded.### Flatpak Builder:
This is a little bit more advanced way of building Flatpak packages, but if you don't want or can't have GNOME Builder, then this method would be your best bet.#### Prerequisites:
- Flatpak Builder `flatpak-builder`
- GNOME SDK runtime `org.gnome.Sdk//47`
- GNOME Platform runtime `org.gnome.Platform//47`Install required runtimes:
```shell
flatpak install org.gnome.Sdk//47 org.gnome.Platform//47
```#### Building Instructions:
##### User installation
```shell
git clone https://github.com/tfuxu/Halftone.git
cd Halftone
flatpak-builder --install --user --force-clean repo/ build-aux/flatpak/io.github.tfuxu.Halftone.json
```##### System installation
```shell
git clone https://github.com/tfuxu/Halftone.git
cd Halftone
flatpak-builder --install --system --force-clean repo/ build-aux/flatpak/io.github.tfuxu.Halftone.json
```### Meson Build System:
If you don't want to install Halftone as a Flatpak package, you can build it using Meson build system. Meson is used in majority of GTK apps and enforced on GNOME core apps, so learning how to use it would be pretty handy if you plan to contribute to other GTK projects.#### Prerequisites:
The following packages are required to build Halftone:
- Python 3 `python`
- PyGObject `python-gobject`
- Blueprint [`blueprint-compiler`](https://jwestman.pages.gitlab.gnome.org/blueprint-compiler/setup.html)
- GTK 4 `gtk4`
- Libadwaita (>= 1.5.0) `libadwaita`
- Imagemagick `imagemagick`
- Meson `meson`
- Ninja `ninja-build`Required Python libraries:
```shell
pip install -r requirements-dev.txt
```#### Building Instructions:
##### Global installation
```shell
git clone https://github.com/tfuxu/Halftone.git
cd Halftone
meson setup builddir
meson configure builddir -Dprefix=/usr/local
sudo ninja -C builddir install
```##### Local build (for testing and development purposes)
```shell
git clone https://github.com/tfuxu/Halftone.git
cd Halftone
meson setup builddir
meson configure builddir -Dprefix="$(pwd)/builddir"
ninja -C builddir install
ninja -C builddir run
```> [!NOTE]
> During testing and development, as a convenience, you can use the `local.sh` script to quickly rebuild local builds.## License
This repository is licensed under the terms of the GNU GPLv3 license. You can find a copy of the license in the COPYING file.## Inspirations:
This project was started after I found out about [Pixfect](https://codeberg.org/daudix-UFO/Pixfect), a little Bash script that does exactly what Halftone does.The original user interface design is based on [Converter](https://gitlab.com/adhami3310/Converter) style, with itself is based on [Upscaler](https://gitlab.gnome.org/World/Upscaler) design.
This README (mostly [How to Build?](#how-to-build) section) is based on [Gradience](https://github.com/GradienceTeam/Gradience) README.