Hey!
I have something like 9000 small (64pxx64px) thumbnails that I need to convert into Black and White.
I tried Irfanview, but it lost some of the information during batch process.
The problem occurs with images that has transparent backgrounds, counter colors Green Lines and Cyan text.
Then I started browsing and found out that ImageMagick could do the job more efficiently and without losing the details.
Anyhow. I don't seem to find a proper command to do the job.
What I've done so far is:
- Open cmd
- Enter the folder where the images are
- type: Mogrify -type Grayscale *.png
- This seems to save all the colors, but the problem is that I'm losing the background transparency AND the images are in grayscale, not straight B&W.
So, could someone with better knowledge, tell me what should I write in the cmd to do the trick:
- All images in B&W
- Transparent Backgrounds as it is before the conversion
Thank you in advance!
-Masa-
*Windows cmd* - Batch Process B&W thumbnails
-
- Posts: 12159
- Joined: 2010-01-23T23:01:33-07:00
- Authentication code: 1151
- Location: England, UK
Re: *Windows cmd* - Batch Process B&W thumbnails
One of the easiest way to convert greyscale into black and white is with "-threshold", eg:
This shouldn't remove transparency.
Code: Select all
mogrify -format tiff -colorspace Gray -threshold 50% xx.png
snibgo's IM pages: im.snibgo.com
Re: *Windows cmd* - Batch Process B&W thumbnails
Thanks.
I think I finally understood at least a bit what I should do there.
I tried this command and it seemed to work as intended aka B&W the images and leave transparent bg's alone:
Is there a way to write that command so that it only transforms 32x32 and 64x64 images, but leaves all the other png's alone?
Since I noticed that there's also some larger images in the same folder that I don't want to transform into B & W.
I think I finally understood at least a bit what I should do there.
I tried this command and it seemed to work as intended aka B&W the images and leave transparent bg's alone:
Code: Select all
mogrify -threshold 90% *.PNG
Since I noticed that there's also some larger images in the same folder that I don't want to transform into B & W.
-
- Posts: 12159
- Joined: 2010-01-23T23:01:33-07:00
- Authentication code: 1151
- Location: England, UK
Re: *Windows cmd* - Batch Process B&W thumbnails
No. The easiest way would be to move or copy the 32x32 and 64x64 images to another directory, and process all the files in that directory. Move or copy by hand or a script.Is there a way to write that command so that it only transforms 32x32 and 64x64 images, but leaves all the other png's alone?
snibgo's IM pages: im.snibgo.com
Re: *Windows cmd* - Batch Process B&W thumbnails
Ok. That's what I thought and started already going trough the images one by one.. Tedious work I tell you!snibgo wrote:No. The easiest way would be to move or copy the 32x32 and 64x64 images to another directory, and process all the files in that directory. Move or copy by hand or a script.Is there a way to write that command so that it only transforms 32x32 and 64x64 images, but leaves all the other png's alone?
One more thing.
Is there any clear instructions how to use the program since it seems to have very high potential?
...if I just learn to use it correctly!
If I understood correctly, you can run a lot more difficult scripts with this too, but not from cmd.. or?
-
- Posts: 12159
- Joined: 2010-01-23T23:01:33-07:00
- Authentication code: 1151
- Location: England, UK
Re: *Windows cmd* - Batch Process B&W thumbnails
For "how to use" guides, see:
http://www.imagemagick.org/Usage/
http://www.imagemagick.org/Usage/basics/
That documentation is now quite old, and doesn't always include new features. The examples are mostly for bash.
For examples with Windows BAT, see my pages.
Like any program, IM can be run by typing at the command prompt, or by running a script.
http://www.imagemagick.org/Usage/
http://www.imagemagick.org/Usage/basics/
That documentation is now quite old, and doesn't always include new features. The examples are mostly for bash.
For examples with Windows BAT, see my pages.
Like any program, IM can be run by typing at the command prompt, or by running a script.
snibgo's IM pages: im.snibgo.com
Re: *Windows cmd* - Batch Process B&W thumbnails
Thank you very much!