Skip to content

lwbt/CropGuiNeu

Repository files navigation

Crop GUI Neu

application window

What is the intended use of this program?

This application is:

  • A simple GTK application to crop JPEG images by selecting a cropping area and saving a copy of the image.

  • Unlike general purpose image manipulation programs it avoids generation loss.

For more information see: FAQ.adoc#why-build-it

Short, non-technical explanation:
Digital images are made up of tiny dots called pixels. These pixels are arranged in groups. If you cut an image along the lines between these groups, you can save the image without losing quality. This is because you don’t have to redo the whole image.

Technical explanation:

It turns out that debian’s jpegtran has a "-crop" flag which performs lossless cropping of jpeg images as long as the crop is to a multiple of what the manpage calls the "iMCU boundary", usually an 8x8 or 16x16 block of pixels. This feature may have been pioneered by Guido of jpegclub.org some years ago.

Supported formats

  • JPEG

It’s just a simple GUI around JPEGtran at the moment. Eventually it will support other popular formats.

Installation

This application is in development and will eventually be available for Linux on Flathub.

Option A: Flatpak bundle via GitHub releases

Download a bundle and install it:
flatpak --user install CropGuiNeu-*-TESTING-*.flatpak

Option B: Flatpak, build it yourself

You can manually clone the repository and build it using the SDK. The Makefile contains all required instructions to build it yourself.

Just run:
make

flatpak --user install CropGuiNeu-*-TESTING-*.flatpak

Option C: Pipx/UV

This installation method was previously preferred. If you can’t use Flatpak, like on a Mac, you can still use Pipx/UV and install the dependencies.

First you will need to install the #dependencies for your platform.

Given that you have already installed Python and Pipx you can install the application using pipx like this:

pipx install git+https://github.com/lwbt/CropGuiNeu.git

Dependencies

Currently the script requires the following external progams to be installed:

  • jpegtran — This program provides the functionality around which the GUI is built.

Ubuntu/Debian:

sudo apt-get update
sudo apt-get install -y libjpeg-turbo-progs

Fedora:

sudo dnf install -y libjpeg-turbo-utils

Arch Linux:

sudo pacman -S libjpeg-turbo

macOS using Homebrew:

brew install libjpeg-turbo

Usage

$ crop_gui_neu --help
usage: crop_gui_neu [-h] [image]

Crop a JPEG image using a GUI.

positional arguments:
  image       Path to the JPEG image to crop

If you installed the application through Flatpak you should be able to run it with:

flatpak --user run io.github.lwbt.CropGuiNeu

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks