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

Option A: Pipx

This installation method is currently preferred.

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

Option B: Flatpak

This application is in development and will eventually be available on Flathub. Until then, you must manually clone the repository and build it using the SDK.

flatpak --user install \
  org.gnome.Platform/x86_64/46
  org.gnome.Sdk/x86_64/46 \

flatpak-builder \
  --force-clean build-dir "io.github.lwbt.CropGuiNeu.yaml"
flatpak-builder \
  --user \
  --install \
  --force-clean build-dir "io.github.lwbt.CropGuiNeu.yaml"

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