The images are stored in JPEG and PNG files. I want to get a list of those of them that are square.
Shell – How to find all square images in a directory
filesimage manipulationimagesshell-script
filesimage manipulationimagesshell-script
The images are stored in JPEG and PNG files. I want to get a list of those of them that are square.
Best Answer
You can do this using the command
convert
from ImageMagick and Awk:The command above will output the list of images that have exactly the same number of pixels horizontally and vertically. If instead what you want to find is images that only visually approximate a square, you can do this:
Note that neither command will work correctly if your images' filenames contain newline characters.