pyguymer3.image¶
A Python sub-module containing a bunch of random image-related functions that I
have written over the years. If you want to use some of these functions directly
from the command line then you can run python3.12 -m pyguymer3.image --help
to see what is available.
Notes
Copyright 2017 Thomas Guymer [1]
References
Modules
|
|
|
Convert a dictionary to an EXIF class |
|
chunksize : int, optional |
|
"exiftool" does not modify, and it does not touch, the image even if it cannot strip anything, therefore it is safe to keep on running "exiftool" on the same image over and over again. |
|
"gifsicle" does modify, and it does touch, the image even if it cannot make it smaller, therefore it is NOT safe to keep on running "gifsicle" on the same GIF over and over again. |
|
Save an image as a GIF |
|
Save an image as a JPG |
|
Save an image as a PNG |
|
Save an image as a WEBP |
|
|
|
"jpegtran" does not modify, but it does touch, the image even if it cannot make it smaller, therefore it is NOT safe to keep on running "jpegtran" on the same JPG over and over again. |
|
Run the "exifread" module or the "exiftool" binary on a file and return the metadata. |
|
|
|
|
|
|
|
Make a PNG |
A Python sub-module containing a functions used in making PNG images that I have written over the years. |
|
|
Manually optimise a PNG image. |
|
Please read the documentation for the four functions: "exiftool", "gifsicle", "jpegtran" and "optipng". |
|
"optipng" does not modify, and it does not touch, the image even if it cannot make it smaller, therefore it is safe to keep on running "optipng" on the same PNG over and over again. |
|
Return information about a PNG |
|
|
|
|
|
|
|
|
|
|
|
|
|
This function returns the HLS complementary colour of an RGB triplet. |
|
This function says if one channel is brighter than the others in an RGB triplet. |
|
This function returns the RGB complementary colour of an RGB triplet. |
|
Save an array as a PGM image. |
|
Save an array as a PNG image. |
|
Save an array as a PPM image. |
|
Save an array as an image |