Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Change 2 colours to 2 different colours
#1
Hello to all,

I need to do the following in GIMP but as fast as possible... as I have to make this change in 900 other files.

Attached photo: Photo
I want the dark red colour to be black and the light red colour to be white and in this way I want to convert it to PNG format... 

If I do it myself, with the pencil I have to click pixel by pixel... is there any way to change the colour faster... because to use it in the machine I need... it only allows black and white PNG.

Thanks!
Reply
#2
Try menu Colors > Threshold...
Reply
#3
You have 900 images to process, you need some sort of batch processing.

Edit: question: What format are the images ?

It can be done using Gimp script-fu but not easy for regular users.

There is a Gimp plugin BIMP for batch processing. A Windows installer here: https://alessandrofrancesconi.it/projects/bimp/  There are examples on the BIMP site.

You need to use "other Gimp procedure" with a "threshold" setting and values as this:

   

There is another procedure to add for saving in png format.

Add your folder of 900 images, set an output folder and apply. There are some restrictions. Original image format png / tif are ok. Format gif gives a black image.
Reply
#4
Thank you very much... the "Threshold" works fine and converts it to black and white... and then I export to PNG.

I don't know if I have enough knowledge to make a batch... but I'm going to try with the links you have told me!

The original images are in .PCX format

Thank you very much again.
Reply
#5
(11-25-2022, 07:31 PM)KS_ Wrote: The original images are in .PCX format

Ah... that is a problem with BIMP which does not import PCX format.

For a non-gimp option, although it is command line try ImageMagick http://www.imagemagick.org

Open a terminal in the folder of PCX images then:

Code:
magick mogrify -format png -colors 2 -type bilevel  *.pcx

will give you 900 black and white png images
Reply
#6
Thank you very much, rich2005!!!

I just did it with imagemagic and the code in the Terminal!!!! Fantastic! Awesome!!!
Thanks again, you have saved me a lot of effort!!!!

Regards!
Reply


Forum Jump: