Main Menu

Search by bit

Started by w64bit, March 03, 2025, 06:39:48 AM

Previous topic - Next topic

w64bit

I am trying to search PNG files by bit. No results.
Can anyone please take a look over these commands, please?
Thank you

exiftool.exe -ext png -if "$SamplesPerPixel eq 1 and $BitsPerSample eq 1" -r -s3 -filename -d "%d%f.%e" "D:\FOLDER" > D:\FOLDER\GRAY_1-bit.txt
exiftool.exe -ext png -if "$SamplesPerPixel eq 1 and $BitsPerSample eq 8" -r -s3 -filename -d "%d%f.%e" "D:\FOLDER" > D:\FOLDER\GRAY_8-bit.txt
exiftool.exe -ext png -if "$SamplesPerPixel eq 1 and $BitsPerSample eq 10" -r -s3 -filename -d "%d%f.%e" "D:\FOLDER" > D:\FOLDER\GRAY_10-bit.txt
exiftool.exe -ext png -if "$SamplesPerPixel eq 1 and $BitsPerSample eq 12" -r -s3 -filename -d "%d%f.%e" "D:\FOLDER" > D:\FOLDER\GRAY_12-bit.txt
exiftool.exe -ext png -if "$SamplesPerPixel eq 1 and $BitsPerSample eq 16" -r -s3 -filename -d "%d%f.%e" "D:\FOLDER" > D:\FOLDER\GRAY_16-bit.txt
exiftool.exe -ext png -if "$SamplesPerPixel eq 1 and $BitsPerSample eq 32" -r -s3 -filename -d "%d%f.%e" "D:\FOLDER" > D:\FOLDER\GRAY_32-bit.txt
exiftool.exe -ext png -if "$SamplesPerPixel eq 3 and $BitsPerSample eq 8" -r -s3 -filename -d "%d%f.%e" "D:\FOLDER" > D:\FOLDER\RGB_8-bit.txt
exiftool.exe -ext png -if "$SamplesPerPixel eq 3 and $BitsPerSample eq 10" -r -s3 -filename -d "%d%f.%e" "D:\FOLDER" > D:\FOLDER\RGB_10-bit.txt
exiftool.exe -ext png -if "$SamplesPerPixel eq 3 and $BitsPerSample eq 12" -r -s3 -filename -d "%d%f.%e" "D:\FOLDER" > D:\FOLDER\RGB_12-bit.txt
exiftool.exe -ext png -if "$SamplesPerPixel eq 3 and $BitsPerSample eq 16" -r -s3 -filename -d "%d%f.%e" "D:\FOLDER" > D:\FOLDER\RGB_16-bit.txt
exiftool.exe -ext png -if "$SamplesPerPixel eq 4 and $BitsPerSample eq 8" -r -s3 -filename -d "%d%f.%e" "D:\FOLDER" > D:\FOLDER\RGB_32-bit.txt

Phil Harvey

We need to know what command shell you are using.  These commands look good to me for Windows CMD, but would probably fail under PowerShell.

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

StarGeek

Always pay attention to the highlighting in Powershell. And PS quoting is different than every other command line.
"It didn't work" isn't helpful. What was the exact command used and the output.
Read FAQ #3 and use that cmd
Please use the Code button for exiftool output

Please include your OS/Exiftool version/filetype

w64bit

I am using them only on Windows CMD.
With TIF, it's working.
With PNG, no.

Phil Harvey

Check to see what tags are available in your PNG images:

exiftool -s FILE.png

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

w64bit

Only:
BitDepth
ColorType

No:
SamplesPerPixel
BitsPerSample

StarGeek

You are looking for EXIF tags, which are not very common in PNG files.
"It didn't work" isn't helpful. What was the exact command used and the output.
Read FAQ #3 and use that cmd
Please use the Code button for exiftool output

Please include your OS/Exiftool version/filetype