A collection of modules for image gallery manipulations, such as: creating animations and slideshows from images in .zip
archives or in folder respectively; comparing image encoding commands (e.g. cjxl
for jpeg xl or avifenc
for avif) (by size, metrics and time); finding images with desired bpp (bits per pixel), monochrome images, or images with specified dimmensions.
Imagescripts-rs
- Features
Each 'module' has a
--help
switch
Moves images that have a bpp value less/greater than the target value.
Example
ims-rs find bpp -l 3.5
Moves image if it's monochrome by computing Mean Squared Error (x100) from mean hue bias by converting each pixel of the thumbnailed image to hsv
Example
ims-rs find monochrome --nproc 16 -t 0.8 -o "./monochrome"
ims-rs find monochrome --nproc 16 -t 1000 -o "./maybe_monochrome"
Moves 'resizable' images with any dimmension larger than the target size.
Default target: 3508px
Example
ims-rs find resizable -s 4961 --keep-empty
Moves similar images using image hashes
Creates slideshow. The video dimmension based on average image size.
Example:
ims-rs gen video -f x264 -c mkv
The .js
or .json
file will be searched in the zip file (w/ any name) or the folder with the zip file (name of zip + .js/.json)
json structure
.js
:
{...,
"frames": [
{
"file": "123.png",
"delay": 200
}, ...] }
.json
:
{"..." :
{...,
"frames": [
{
"file": "123.png",
"delay": 200
}, ...] } }
Example:
ims-rs gen zip2video *.zip
Utility for codecs/parameters comarison
Example:
ims-rs cmds --csv --save -c "avif_q(4,14)" "cjxl_d(0.7)" "cjxl_l(7)"
Example output:
./test1.png
26.9KiB --> 19.4KiB 72% * 0.11s avifenc ...
19.4KiB --> 45.2KiB 233% 0.03s cjxl -d 0.7 -j 0
19.4KiB --> 12.9KiB 66% * 0.03s cjxl -d 0 -j 0 -e 7
./test2.png
254.4KiB --> 91.5KiB 35% * 4.54s avifenc ...
91.5KiB --> 304.9KiB 333% 0.22s cjxl -d 0.7 -j 0
91.5KiB --> 298.7KiB 326% 0.55s cjxl -d 0 -j 0 -e 7
./test3.png
21.3KiB --> 6.1KiB 28% * 0.10s avifenc ...
6.1KiB --> 13.2KiB 215% 0.03s cjxl -d 0.7 -j 0
6.1KiB --> 11.2KiB 182% 0.04s cjxl -d 0 -j 0 -e 7
stats:
count cmd
2 avifenc ...
1 cjxl -d 0 -j 0 -e 7