A terminal utility to sort image files based on their characteristics.

Overview

About

A terminal utility to sort image files based on their characteristics.

Motivation

This program was developed after I've realized that I had too many wallpapers, and too little time. Although there are more advanced programs with a wider range of features (e.g.: variety, hydrus) most of the times I just want to filter my wallpapers by resolution or ratio from my downloads to my wallpaper folder, without leaving my terminal.

As so this tool was born, a minimal solution, which is meant to be used in a terminal ecosystem with other common utilities found in Linux based OSs, to assist the user in filtering image files.

Installation

Dependencies

This program requires Python version 3 as well as the following packages:

These packages are automatically resolved by pip.

Stable version

Install this program directly from Pypi:

$ pip install imgsort

Development version

For the latests updates, install the program directly from the dev branch on this repository:

$ pip install -e git+https://github.com/jpmvferreira/[email protected]#egg=imgsort

If instead you want to make changes to the source code, then clone this repository locally and install it in editable mode:

$ git clone https://github.com/jpmvferreira/imgsort
$ pip install -e imgsort

Usage

Let us now see this program in action with a few examples. Remember that at any time the help dialog (-h or --help) is available to provide information regarding the available flags.

To tell if wallpaper1.jpg in your current working directory is 1920x1080, then using the -s or --size flag:

$ imgsort wallpaper1.jpg -s 1920x1080

If the file is 1920x1080 then it will print its name, otherwise, it will print nothing.

If instead you want to know if wallpaper1.jpg is 16:9, you can use the same flag with with a ':' instead of the 'x':

$ imgsort wallpaper1.jpg -s 16:9

This can also be used for several files, with different formats:

$ imgsort wallpaper1.jpg wallpaper2.png -s 1920x1080

Naturally you can make use of bash's features, for example the wildcard statement, to filter a set of files which match a given pattern, in this case all of the .jpg files in the current working directory:

$ imgsort *.jpg -s 1920x1080

This program also reads from STDIN, which means that you can create pipelines with it.

For example, if you wish to tell if all your wallpapers, located at ~/wallpapers and respective subfolders, are 1920x1080, then create the following pipeline with find:

$ find ~/wallpapers | imgsort -s 1920x1080

If you wish to filter out all the wallpapers that are not 1920x1080, then you can rely on the -o or --opposite flag, which prints the file name if it doesn't match the provided size:

$ find ~/wallpapers | imgsort -s 1920x1080 -o

You can keep on adding to this pipeline to apply further actions.

Let's say you're trying to move all of your 1920x1080 wallpapers from ~/wallpapers/unsorted to ~/wallpapers/fullhd. By using the pipeline created above, and using xargs to which converts content found in STDIN to command line arguments, we can move all of those files to their designated location:

$ find ~/wallpapers/unsorted | imgsort -s 1920x1080 | xargs -I '{}' mv {} ~/wallpapers/fullhd

If you want to be sure that the program isn't doing anything funny, which you should, use -v or --verbose to print the image resolution or ratio to STDERR, which shouldn't affect the pipeline.

Contributing

If you happen to find a bug, have a question or would like to suggest a feature or simply share some fancy terminal wizardry, feel free to open up an issue.

Release cycle

This is a (very) small project, however, I do like to keep things tidy. As such I made a release cycle which goes as follows.

The first version will be 1.0.0, which is released once I consider that the program is good enough, and all the following versions will have the format X.Y.Z.

Each time that there is an update which does not modify the program behavior (e.g.: documentation, packaging) it will increment Z (e.g.: 1.0.0 -> 1.0.1).

Each time that there is an update which modifies the program behavior (e.g.: adding features, fixing bugs) it will increment Y and reset Z (e.g.: 1.0.1 -> 1.1.0).

Each time that there is an update which is not backwards compatible (e.g.: removing features, fundamental change on how the program is used) it will increment X and reset both Y and Z (e.g.: 1.1.2 -> 2.0.0).

In this Github repository you will find branches for the stable version (master) and the development version (dev). All modifications are done in the development branch and, after being tested, are included in the stable version, with the appropriate version bump.

License

MIT

Owner
José Ferreira
MSc student in Astrophysics and Cosmology at Instituto de Astrofísica e Ciências do Espaço (IA), in Faculty of Sciences of the University of Lisbon (FCUL)
José Ferreira
You'll never want to use cd again.

Jmp Description Have you ever used the cd command? You'll never touch that outdated thing again when you try jmp. Navigate your filesystem with unprec

Grant Holmes 21 Nov 03, 2022
A user-friendly python CLI for Fmask 4.3 software (GERS Lab, UCONN).

pyFmask What is pyFmask pyFmask is a user-friendly python CLI for Fmask 4.3 software (GERS Lab, UCONN; https://github.com/GERSL/Fmask). Fmask (Zhu et

1 Jan 05, 2022
A Bot Which Send Automatically Commands To Karuta Hub to Gain it's Currency

A Bot Which Send Automatically Commands To Karuta Hub to Gain it's Currency

HarshalWaykole 1 Feb 09, 2022
An easy-to-bundle GTK terminal emulator.

EasyTerm An easy-to-bundle GTK terminal emulator. This project is meant to be used as a dependency for other

Bottles 4 May 15, 2022
Magnificent app which corrects your previous console command.

The Fuck The Fuck is a magnificent app, inspired by a @liamosaur tweet, that corrects errors in previous console commands. Is The Fuck too slow? Try t

Vladimir Iakovlev 75k Jan 02, 2023
A simple command line virtual operating system, written in python

Virtual operating system A simple virtual operating system written in python. (Under development). Currently, the following commands are supported: Co

B.Jothin kumar 7 Nov 15, 2022
Random scripts and other bits for interacting with the SpaceX Starlink user terminal hardware

starlink-grpc-tools This repository has a handful of tools for interacting with the gRPC service implemented on the Starlink user terminal (AKA "the d

270 Dec 29, 2022
🌌 A Python script to generate blog banners from command line.

Auto Blog Banner Generator A Python script to generate blog banners. This script is used at RavSam. The following image is an example of the blog bann

RavSam 10 Sep 20, 2022
🎮 An easy to use tool to change the mapping of your input device buttons.

Input Remapper Formerly Key Mapper An easy to use tool to change the mapping of your input device buttons. Supports mice, keyboards, gamepads, X11, Wa

Tobi 1.9k Jan 05, 2023
Kubernetes shell: An integrated shell for working with the Kubernetes

kube-shell Kube-shell: An integrated shell for working with the Kubernetes CLI Under the hood kube-shell still calls kubectl. Kube-shell aims to provi

CloudNative Labs 2.2k Jan 08, 2023
A CLI tool for searching and watching videos on youtube with no spyware and MPV and yt-dlp

A CLI tool for searching and watching videos on youtube with no spyware and MPV and yt-dlp

TruncatedDinosour 3 Feb 22, 2022
Helping you manage your data science projects sanely.

PyDS CLI Helping you manage your data science projects sanely. Requirements Anaconda/Miniconda/Miniforge/Mambaforge (Mambaforge recommended!) git on y

Eric Ma 16 Apr 25, 2022
xonsh is a Python-powered, cross-platform, Unix-gazing shell

xonsh is a Python-powered, cross-platform, Unix-gazing shell language and command prompt.

xonsh 6.7k Dec 31, 2022
CLTools provides various tools and command to use in the terminal.

CLTools provides various tools and command to use in the terminal. As of date, CLTools is only able to generate temporary email addresses and receive emails. There are plans to integrate more tools a

Ashwin Chugh 2 Feb 14, 2022
The WalletsNet CLI helps you connect to WalletsNet

WalletsNet CLI The WalletsNet CLI helps you connect to WalletsNet. With the CLI, you can: Trigger webhook events or resend events for easy testing Tai

WalletsClub 8 Dec 22, 2021
A Tempmail Tool for Terminal and Termux.

A Tempmail Tool for Terminal and Termux.

MAO-COMMUNITY 8 Oct 19, 2022
Terminal with builtin ortholinear keyboard and touch screen as a home automation interface.

OLKB-Terminal Terminal with builtin ortholinear keyboard and touch screen as a home automation interface. Features Step and STLs available for non-com

Jeff Eberl 50 Oct 07, 2022
Get Air Quality Index for your city/country 😷

Air Quality Index CLI Get Air Quality index for your City. Installation $ pip install air-quality-cli Contents Air Quality Index CLI Installation Cont

Yankee 40 Oct 21, 2022
Voidlx is a terminal cli apps launcher made in python

Voidlx is a terminal cli apps launcher made in python

2 Nov 13, 2021
pypyr task-runner cli & api for automation pipelines.

pypyr task-runner cli & api for automation pipelines. Automate anything by combining commands, different scripts in different languages & applications into one pipeline process.

pypyr 471 Dec 15, 2022