Identify all colors in graphic (with treshhold) and then do on-the-fly color changes

The right place to speak and share about your experiences of GraphicConverter
Post Reply
porg
Posts: 554
Joined: Tue Apr 05, 2022 1:04 pm
Country: Austria

Identify all colors in graphic (with treshhold) and then do on-the-fly color changes

Post by porg »

IconFinder.com has a Color Editor looking like this:
- You have a section "Document Colors" which each can be replaced with an arbitrary color.
IconFinderCom Color Editor - Change the document colors.png
IconFinderCom Color Editor - Change the document colors.png (269.5 KiB) Viewed 690 times


When editing line art graphics in GraphicConverter (logos or illustrations as PNG) this feature could be handy.

It would work mostly the same, only would need a color-indexing when starting the process.

When calling this function GC would first run a color indexing (with the last or the default setting) and internally saves these representations:
- Source Image with its colors
- Output Image with the replaced colors.
- Mapping of each source color to the target color.
- This is important, because with this setup each color of the source image is a UID, which can map to any other color, and you can change all of these independently without any unwanted side effects.
- Then the section "Document Colors" is ready for you. The Re-Index button inactive.
- Color replacing works as iconfinder.com's Color Editor.

Code: Select all

Document Colors:     8 of 822 total  [ Re-Index ]
(•) Index top X colors:                 [  6 ]  1 .....|..................  24
( ) Color present in min. % of pixels:   2.5%   0 ..|..................... 100

🟣  🟡  🟢  🔵  🔴  🟠
- If you would change any of the settings then the Re-Index button gets hot again.
- Clicking it gives you a dialog: "Warning: Reindexing will destroy the calculated color-index of your source file and the mapping to the replacement colors" Cancel / Re-Index.
porg
Posts: 554
Joined: Tue Apr 05, 2022 1:04 pm
Country: Austria

Re: Identify all colors in graphic (with treshhold) and then do on-the-fly color changes

Post by porg »

In addition to this on-the-fly mass color swapping approach, you may also like this approach:
Select color (with tolerance level regarding hue/saturation/brightness) & replace with other color (fixed or tolerance)
User avatar
forum_adm
Site Admin
Posts: 1814
Joined: Fri Dec 23, 2016 9:41 am
Location: Germany
Country: Germany
Contact:

Re: Identify all colors in graphic (with treshhold) and then do on-the-fly color changes

Post by forum_adm »

You can do the same with Find and Replace Color.
porg
Posts: 554
Joined: Tue Apr 05, 2022 1:04 pm
Country: Austria

Re: Identify all colors in graphic (with treshhold) and then do on-the-fly color changes

Post by porg »

No practically you can't.

With a Color Editor you can:
1) change multiple colors sequentially very quickly.
2) the original colors remain maintained uniquely and can be replaced with any other color.

Both is not the case with GC's Find and replace colors:
Ad 1) You have to do this all by hand with many steps inbetween.

Ad 2) The process is very likely to suffer destructive cross-effects!

Take this example::
- Original image: Colors ID-1 = 🔵, Colors ID-2 = 🔴, Colors ID-3 = 🟤
- Operated image: ID-1 → 🔴, ID-2 → 🔵, ID-3 → ⚫️

Possible with Color Editor as ID-1 remains a UID in the original image. Whereas GC's Find and Replace color would set ID-1 to 🔴, and from then on both pixels of ID-1 and ID-2 are 🔴, and you cannot treat them separately anymore. As soon as changing ID-2 to 🔵, also the original ID-1 pixels would get 🔵.
You can only work with auxillary colors. And then get to the intended colors. A very cumbersome uncreative process, practically impossible.

Whereas in the Color Editor (which maintains original image, original palette, manipulated image, new palette) all this can happen at once, very convenient for the user.
User avatar
forum_adm
Site Admin
Posts: 1814
Joined: Fri Dec 23, 2016 9:41 am
Location: Germany
Country: Germany
Contact:

Re: Identify all colors in graphic (with treshhold) and then do on-the-fly color changes

Post by forum_adm »

GraphicConverter has currently no indexed color space. So, such a function is not possible, yet.
Post Reply