makro for replacing colors

DJ
Posted By
Daniel Jung
Sep 6, 2004
Views
420
Replies
8
Status
Closed
Hi

I made an animated gif to be displayed
while waiting for a download:
http://lingo.uib.no/daniel/wait/wait.gif

Three of the 21 source files are in the same
catalogue: http://lingo.uib.no/daniel/wait.
The question is not about the animated gif,
but about changing the source files.

I have ten different skins, and I want
to change the colors to fit these skins.
The bars in the background must remain exactly
the same, but the colored blocks should have
other colors.

E.g.: The colored block like it is now has
a color value of #E8AC57. I want to change
all five blocks from amber: #E8AC57 to blue:
#7187B3. That is, the 100% amber fill should be
100% blue fill, and the lighter amber block (80%)
should be equally lighter in blue (80%) and so on.

I tried in vain to write a makro/batch to perform
the color change on the source file. I tried to set
Color Range on an image on basis of the deepest;
that got me selected four blocks. Selecting on
basis on the next deepest got me all five. Either
way: when I Replace Color within the color range,
the background gets changed as well. I have manually
Magic Wand-ed the blocks to restrict the changing
area to them, and then filled the blocks, but a makro
wouldn’t be able to perform this I guess, since the
blocks move in position.

I don’t want to Transform by moving the HUE glider
in the Color Replace pane, since I know (and want)
exactly these hex values

#E8AC57
#7187B3
#D8D8D7
#FDEB72
#85FC5B
#DC5BFC
#D54848
#75FCF5
#929292
#EAB97F

How can I write a makro to do this
and spare me the work of manually doing
21 files * 9 remaining skins * 5 blocks = 945 fills?

I have Photoshop 7.0.

Thanks
– Daniel

How to Master Sharpening in Photoshop

Give your photos a professional finish with sharpening in Photoshop. Learn to enhance details, create contrast, and prepare your images for print, web, and social media.

I
iehsmith
Sep 7, 2004
Daniel,

I may be wrong, but I don’t think a macro/action to change your colors to the exact color you want is plausible. I take it you did not save your original layered PSD files for these?

In PS6.01/Mac, Replace Color works pretty well without changing the gray lines, but not to exact colors. Also, if you select your target color for the foreground color in the tool palette, then marquee select your 12×24 colored rectangles and go to Image:Adjust:Hue/Saturation, leave it at Master and and click Colorize you will get close to your target color and can adjust from there. But, the only way I know to get the exact colors you want is to duplicate (or make a pattern and fill) your gray lines to cover those colors in a new layer. Then make another new layer to do your color fills of the rectangles at your varied tranparencies. Then you can duplicate that layer, lock tranparency and fill with another new color. I’m sending you a PSD file separately.

inez

On 9/6/04 2:08 PM, Daniel Jung uttered:

Hi

I made an animated gif to be displayed while waiting for a download: http://lingo.uib.no/daniel/wait/wait.gif

Three of the 21 source files are in the same catalogue:
http://lingo.uib.no/daniel/wait. The question is not about the animated gif, but about changing the source files.

I have ten different skins, and I want to change the colors to fit these skins. The bars in the background must remain exactly the same, but the colored blocks should have other colors.

E.g.: The colored block like it is now has a color value of #E8AC57. I want to change all five blocks from amber: #E8AC57 to blue: #7187B3. That is, the 100% amber fill should be 100% blue fill, and the lighter amber block (80%) should be equally lighter in blue (80%) and so on.

I tried in vain to write a makro/batch to perform the color change on the source file. I tried to set Color Range on an image on basis of the deepest; that got me selected four blocks. Selecting on basis on the next deepest got me all five. Either way: when I Replace Color within the color range, the background gets changed as well. I have manually Magic Wand-ed the blocks to restrict the changing area to them, and then filled the blocks, but a makro wouldn’t be able to perform this I guess, since the blocks move in position.
I don’t want to Transform by moving the HUE glider in the Color Replace pane, since I know (and want) exactly these hex values

#E8AC57
#7187B3
#D8D8D7
#FDEB72
#85FC5B
#DC5BFC
#D54848
#75FCF5
#929292
#EAB97F

How can I write a makro to do this and spare me the work of manually doing 21 files * 9 remaining skins * 5 blocks = 945 fills?

I have Photoshop 7.0.

Thanks
– Daniel
MR
Mike Russell
Sep 7, 2004
Daniel Jung wrote:
Hi

I made an animated gif to be displayed
while waiting for a download:
http://lingo.uib.no/daniel/wait/wait.gif

Three of the 21 source files are in the same
catalogue: http://lingo.uib.no/daniel/wait.
The question is not about the animated gif,
but about changing the source files.

I have ten different skins, and I want
to change the colors to fit these skins.
The bars in the background must remain exactly
the same, but the colored blocks should have
other colors.

E.g.: The colored block like it is now has
a color value of #E8AC57. I want to change
all five blocks from amber: #E8AC57 to blue:
#7187B3. That is, the 100% amber fill should be
100% blue fill, and the lighter amber block (80%)
should be equally lighter in blue (80%) and so on.

I tried in vain to write a makro/batch to perform
the color change on the source file. I tried to set
Color Range on an image on basis of the deepest;
that got me selected four blocks. Selecting on
basis on the next deepest got me all five. Either
way: when I Replace Color within the color range,
the background gets changed as well. I have manually
Magic Wand-ed the blocks to restrict the changing
area to them, and then filled the blocks, but a makro
wouldn’t be able to perform this I guess, since the
blocks move in position.

I don’t want to Transform by moving the HUE glider
in the Color Replace pane, since I know (and want)
exactly these hex values

#E8AC57
#7187B3
#D8D8D7
#FDEB72
#85FC5B
#DC5BFC
#D54848
#75FCF5
#929292
#EAB97F

How can I write a makro to do this
and spare me the work of manually doing
21 files * 9 remaining skins * 5 blocks = 945 fills?

I have Photoshop 7.0.

Two procedures:

1) [ImageReady]

You may want to make 9 additional copies of the animated gif, one for each skin, and name them appropriately. Open each file, select the Color Table palette, double click each color you want to change, and type each new hex value into the field marked #. Click the optimized tab to see your new image, and play it in the Animation window. Use either "File>Save Optimized", "File>Save Optimized As…" depending on whether you started with your original or a copy, to save your new image.

2) [PhotoShop]

If you are a glutton for extra work, you can do this in PhotoShop using color palettes. This may be closer to what you want because it will modify the individual source files, provided those files are in indexed mode. Call your existing set of gifs the "master set". Copy them to a safe place. I suggest you start with separate folders for each skin, and copy the master images to each skin.

Open one of your master gif images, go to Image>Mode>Color Table. Start by saving this palette as your master palette. It is not needed for conversions, but will be useful later. Now click in the palette on each color you want to change, and type your hex values into the # field. Unclick the eyedropper button, and click the palette. Save the Palette, then the image to the correct skin folder.

Note: you may, if you wish, locate a color by clicking on the image instead of the palette. Click the eyedropper button, and click on the image to "hilight" the corresponding palette entry with a checkerboard pattern. Unclick the eyedropper and click on the checked entry to edit its value.

You can now manually load the saved palette for each of the remaining 20 files, but I suggest you save some work and create a droplet as follows.

Create a new action, and click record. Run Image>Mode>Color Table, and load the color table file you just created. Stop the recording, save the action as a droplet in the appropriate skins folder, drag copies (!) of the remaining 20 files onto the droplet. You may use this droplet next time you modify the master, copy of the animations, or load the master palette when you first create animations that use the same color scheme.

Set your view options, if necessary, to show thumbnails so that you may quickly check your work. It does no harm to set the same color table multiple times.

Repeat for the other skins. One advantage of this procedure is that once you’ve set up the droplets, you may change the color tables for all of your gifs, not just the animated ones, in one operation.

YWIA


Mike Russell
www.curvemeister.com
www.geigy.2y.net
DJ
Daniel Jung
Sep 7, 2004
Hi!

Thanks very much for an elaborate explanation!
I appreciate your answer very much.

I preferred the second solution, as it has a more flexible result for later work, and because it makes me learn more about the whole palette thing. But I still have some questions.

In article <lad%c.12599$>,
says…

2) [PhotoShop]
[…]
Open one of your master gif images, go to Image>Mode>Color Table. […] Now click in the palette on each
color you want to change, and type your hex values into the # field.

I kind of wanted to avoid to set each color seperately though – I don’t know the equivalent in the other range. With the method you suggested here, I would have to manually set 11 color values. The color palette tells me there are 11 yellowish colors, two grey and two black and one white.

Aside: There are 5 blocks. One is 100%, that’s one color. The other four are not completely filled, so they have two colors each – a faded amber on white and a faded amber on grey. That makes 9 colors total. I guess the 11 colors in the palette and the doubled grey and black is just to add up to 16 colors, which must be the next range when surpassing 8 colors. /aside.

OK, I can do that once and create a droplet, like you suggested, but I don’t know what the hex values are for the 10 other shades in the same palette. All I know is that I made the amber skin some time ago (can’t seem to find the layered source file though… arrgh…), and I have the amber hex value (full fill),
and that I made the other blocks faded shades of the same source hex value. It might have been 80%, 60%, 40%, 20% of the original, but I don’t know that for sure. I was looking for an algorithm of some kind that could automatically change amber (#E8AC57) to blue (#7187B3), and as a logical next step take everything else (which is not black or white or grey) and fade it accordingly. In other words, I want to say:

"Change all yellowish/reddish to blueish where #E8AC57 is the maximum yellowish/reddish and #7187B3 is the maximum blueish. Where there is less saturation, take the saturation value and apply it to the new color fill, fading the rest to white. Don’t touch neutral hex values (000000, c3c3c3, ffffff). Replace the old block completely with the new (don’t fill 80%, even if if the saturation is 80%)."

Did that make sense? Is that possible?

I can use the eyedropper and find out what the 9 amber shades are (or the palette, it’s all there already, only it tells me there are 11), then I have the hex values. Is there a way of telling mathematically what

amber: E8AC57 / E2BE8B / EDBD79 / …

would equal to in

blue: 7187B3 / ? / ? / …
… :
… :

where I just know the first one? Sorry if I repeat myself. Or could that be done in another program (script) than Photoshop?

I will look into the ImageReady solution next. Thanks again.

– Daniel
DJ
Daniel Jung
Sep 7, 2004
Hi Inez,

and thanks very much for the answer here and the work you put in the zipfile i got in my email.

In article <BD62A71D.25B9E%>,
says…
I may be wrong, but I don’t think a macro/action to change your colors to the exact color you want is plausible. I take it you did not save your original layered PSD files for these?

I wouldn’t be the moron I am if I had kept it… And I wouldn’t be the moron I am if I didn’t create only one file and changed the blocks manually in the original, making a "save for web" 21 times on the original and not keeping the history. One knows always so much better afterwards… I want to avoid repeating this kind of utter stupidity, so i turned to this newgroup for help. Which I got.

[…] But, the only way I know to get the exact colors you want is to duplicate (or make a pattern and fill) your gray lines to cover those colors in a new layer.

I kept the pattern and saved them in the pattern palette! So I still have the bars and can fill a layer with that.

Thanks very much, that helped a lot!

– Daniel
MR
Mike Russell
Sep 7, 2004
Daniel Jung wrote:
Hi!

Thanks very much for an elaborate explanation!
I appreciate your answer very much.

I preferred the second solution, as it has a more flexible result for later work, and because it makes me learn more about the whole palette thing. But I still have some questions.

In article <lad%c.12599$>,
says…

2) [PhotoShop]
[…]
Open one of your master gif images, go to Image>Mode>Color Table.
[…] Now click in the palette on each
color you want to change, and type your hex values into the # field.

I kind of wanted to avoid to set each color seperately though – I don’t know the equivalent in the other range. With the method you suggested here, I would have to manually set 11 color values. The color palette tells me there are 11 yellowish colors, two grey and two black and one white.

Aside: There are 5 blocks. One is 100%, that’s one color. The other four are not completely filled, so they have two colors each – a faded amber on white and a faded amber on grey. That makes 9 colors total. I guess the 11 colors in the palette and the doubled grey and black is just to add up to 16 colors, which must be the next range when surpassing 8 colors. /aside.

OK, I can do that once and create a droplet, like you suggested, but I don’t know what the hex values are for the 10 other shades in the same palette. All I know is that I made the amber skin some time ago (can’t seem to find the layered source file though… arrgh…), and I have the amber hex value (full fill),
and that I made the other blocks faded shades of the same source hex value. It might have been 80%, 60%, 40%, 20% of the original, but I don’t know that for sure. I was looking for an algorithm of some kind that could automatically change amber (#E8AC57) to blue (#7187B3), and as a logical next step take everything else (which is not black or white or grey) and fade it accordingly. In other words, I want to say:
"Change all yellowish/reddish to blueish where #E8AC57 is the maximum yellowish/reddish and #7187B3 is the maximum blueish. Where there is less saturation, take the saturation value and apply it to the new color fill, fading the rest to white. Don’t touch neutral hex values (000000, c3c3c3, ffffff). Replace the old block completely with the new (don’t fill 80%, even if if the saturation is 80%)."
Did that make sense? Is that possible?

I can use the eyedropper and find out what the 9 amber shades are (or the palette, it’s all there already, only it tells me there are 11), then I have the hex values. Is there a way of telling mathematically what

amber: E8AC57 / E2BE8B / EDBD79 / …

would equal to in

blue: 7187B3 / ? / ? / …
… :
… :

where I just know the first one? Sorry if I repeat myself. Or could that be done in another program (script) than Photoshop?
I will look into the ImageReady solution next. Thanks again.

One way to set the intermediate colors is to manually type in the first hex value, and then change only the Hue value in HSB, retaining the previous saturation and brightness. Then you will get a smooth interpolation of shades as required for your design.


Mike Russell
www.curvemeister.com
www.geigy.2y.net
DJ
Daniel Jung
Sep 7, 2004
Hi again

Just to follow up, in case you are interested. With Inez’ kind help, I managed to build myself a literal color table like this:

E8AC57 E5B571 EDBD79 E2BE8B F1CD9A DEC6A4 F6DEBC DBCFBE FAEEDD 7187B3 8697BB 8D9FC2 9BA8C2 AAB7D1 AFB8C9 C6CFE1 C3C8D1 E3E7F0 FDEB72 F6E787 FDEF8E EEE39B FEF3AA E7E0B0 FEF7C7 E0DDC4 FFFBE3 85FC5B 96F574 9DFD7C A6EE8D B6FD9D B7E7A7 CEFEBD C7DFBF E7FEDE DC5BFC DB74F5 E37CFD DA8DEE EA9DFD DAA6E6 F1BDFE D9BFDF F8DEFE D54848 D66565 DD6D6D D78282 E69191 D79F9F EEB6B6 D8BCBC F7DADA 75FCF5 89F5EF 91FDF7 9DEEEA ACFDF9 B0E6E4 C8FEFB C4DFDE E3FEFD 929292 A0A0A0 A8A8A8 AEAEAE BEBEBE BDBDBD D3D3D3 CBCBCB E9E9E9 EAB97F E6BF91 EEC799 E3C5A3 F2D5B2 E0CCB5 F7E3CC DCD2C6 FBF1E5

(ok, not interesting).

Then I followed everything you said, and it made complete sense. I copied the files to one folder "azure", opened one file (indexed), opened the color table, changed the hex value of the amber boxes in that table manually to what it equals in the azure range, saved the color palette as azure.act. Nice effect, this one image turned out exactly how I wanted. Startet an action and recorded the procedure of changing the color table as "azure.exe". Then I took all the files in the azure folder and dropped it onto the droplet, and everything was changed in a second like expected. Nice.

But: When I verified the files one by one, some of them turned out dead crappy. (screenshot: http://lingo.uib.no/daniel/wait/droplet.jpg)

I guess the indexing order of the original files got skewed somehow, so the matches got mismatched and white was changed to blue etc.

Any ideas on how I could work around that?

– Daniel
DJ
Daniel Jung
Sep 7, 2004
Hi

I may have been a little fast in my last posting.

In article , says…

But: When I verified the files one by one, some of them turned out dead crappy. (screenshot: http://lingo.uib.no/daniel/wait/droplet.jpg)
I guess the indexing order of the original files got skewed somehow, so the matches got mismatched and white was changed to blue etc.

I can see that the crappy ones are the ones which don’t have five blocks, but four or three. That would be the ones where the moving section is near the left and right border, to create that effect of bouncing. I can understand that the color table is different in the original files. Wow, that means that I have to make seperate color tables and possibly droplets for each of those bounce-files?

And still: wait011.gif has black lines and a funny color progression. I guess that means that the original wait011 was not built exactly the same as the others? The files are in
http://lingo.uib.no/daniel/wait/azure/.

Maybe it would be simpler if I made the job all over again from scratch, but RIGHT this time. I wonder how to proceed this time. One striped background layer, 12 layers with amber blocks on top of that, and then set the opacity of the layers individually for each of the 21 or something stages? Then change the 12 layers to the next color (I guess this can be done in one step), and redo the stages? Hmmm. I should probably save each of these stages as a psd, and drop them of them to a droplet of some kind.

I am glad I don’t have a deadline for that and can try different things.

Thanks for all your help, and Inez.

– Daniel
MR
Mike Russell
Sep 8, 2004
Daniel Jung wrote:
Hi

I may have been a little fast in my last posting.

In article ,
says…

But: When I verified the files one by one, some of them turned out dead crappy. (screenshot:
http://lingo.uib.no/daniel/wait/droplet.jpg)

I guess the indexing order of the original files got skewed somehow, so the matches got mismatched and white was changed to blue etc.

I can see that the crappy ones are the ones which don’t have five blocks, but four or three. That would be the ones where the moving section is near the left and right border, to create that effect of bouncing. I can understand that the color table is different in the original files. Wow, that means that I have to make seperate color tables and possibly droplets for each of those bounce-files?
And still: wait011.gif has black lines and a funny color progression. I guess that means that the original wait011 was not built exactly the same as the others? The files are in
http://lingo.uib.no/daniel/wait/azure/.

Maybe it would be simpler if I made the job all over again from scratch, but RIGHT this time. I wonder how to proceed this time. One striped background layer, 12 layers with amber blocks on top of that, and then set the opacity of the layers individually for each of the 21 or something stages? Then change the 12 layers to the next color (I guess this can be done in one step), and redo the stages? Hmmm. I should probably save each of these stages as a psd, and drop them of them to a droplet of some kind.

I am glad I don’t have a deadline for that and can try different things.

Thanks for all your help, and Inez.

The PhotoShop method seems even more complex than I thought.

It may be time to edit the color table of the animated gif directly in Elements. This is relatively easy to do, and since the frames of the animation share the same color table, you will avoid problems with some source files having different numbers of color table entries.

Once you have altered one of the hex values to match the skin color, make a note of the Hue value. You may avoid having to type in most of the hex values if you change only the hue value of the intermediate shades to retain the shade of the original bars.


Mike Russell
www.curvemeister.com
www.geigy.2y.net

Must-have mockup pack for every graphic designer 🔥🔥🔥

Easy-to-use drag-n-drop Photoshop scene creator with more than 2800 items.

Related Discussion Topics

Nice and short text about related topics in discussion sections