Resources and Support
 Pixel Joint Forum : The Lounge : Resources and Support
Message Icon Topic: How to check used colors and replace them in PS? Post Reply Post New Topic
Author Message
Dhanh
Seaman
Seaman
Avatar

Joined: 29 October 2013
Online Status: Offline
Posts: 8
Quote Dhanh Replybullet Topic: How to check used colors and replace them in PS?
    Posted: 29 October 2013 at 5:42pm
Hi, I´m making a game using pixel art assets and I wanted to keep the color pallet consistent throughout the game but it seems there´s always some involuntary color variations popping up here and there by mistake.
Is there a way to check what colors are being used in all layers of the document in Photoshop CS6? And is there a way to replace all instances of a certain color in all layers of a document?
It would be great to have something like a color swatch that would show only the colors used in that document and that by changing a color on that swatch it would update all pixels with that color on the document...

If you know how to do this in PS it would be great but other softwares or plugins suggestions for this would also be much appreciated!

Thanks!

Dan


IP IP Logged
AlexHW
Commander
Commander
Avatar

Joined: 19 June 2019
Online Status: Offline
Posts: 285
Quote AlexHW Replybullet Posted: 29 October 2013 at 6:08pm
I know you can go to > file > save for web & devices, and it'll show you a table of the colors being used (or at least visible in the image).

As for changing the same color on multiple layers, one way is to use the paintbucket tool and set the "All Layers" option on, and the "Contiguous" option off..
But that will essentially paintbucket the color on the current layer (even though it paints over all the pixels of the same color from each layer)..

You could create a macro that does this:

select top left pixel (corner of image).. fill with foreground color..
deselect..
magic wand tool the top left corner with "contiguous" set off (this will select all the pixels with same color)...
then fill with background color(the new color you want)..
then deselect.. select only the top left pixel, clear it...
then repeat this for each layer...

This macro would do the trick you're asking for.
IP IP Logged
Dhanh
Seaman
Seaman
Avatar

Joined: 29 October 2013
Online Status: Offline
Posts: 8
Quote Dhanh Replybullet Posted: 29 October 2013 at 6:53pm
Thanks Alex! That macro should do the trick (once I find the colors I want to change)! Is there no other way to show those slight color variations in Photoshop? Maybe It´s a bit of an OCD trying to find color variations that are so subtle that I cant see the difference but it would be nice to be able to have a plugin or something to do that. Also I wanted to organize my pallet in the swatches but PS does not allow me to change color positions or values, do I have to erase all of them and start over in the right order? How do you guys store update and organize your pallets in PS? Am I using the wrong software for pixel art? (These features seem so important for pixel art that there must be a more appropriate software for that right?)

Thanks again for you answer!
IP IP Logged
AlexHW
Commander
Commander
Avatar

Joined: 19 June 2019
Online Status: Offline
Posts: 285
Quote AlexHW Replybullet Posted: 29 October 2013 at 7:16pm
no problem..
I don't use swatches. If you use the pencil tool, you can just hold the Alt key to eyedrop any color in your image. This is also an easy way to check if any color is different, because you'll notice the rgb values change (if you have the color window open).
So basically, my image is my palette, and I just eyedrop my colors if I want to use one I've already used.

Another way of finding pixels that have slight color differences is to use the magic wand tool, and make sure the tolerance is set to 0 so it selects only colors of same color, and then start selecting colors that might have other colors lurking in them, and you'll see them if it doesn't select them.

Usually I keep my colors fairly distinct from one another so I usually don't have this problem.
IP IP Logged
Dhanh
Seaman
Seaman
Avatar

Joined: 29 October 2013
Online Status: Offline
Posts: 8
Quote Dhanh Replybullet Posted: 29 October 2013 at 8:08pm
Thanks, will do that! The color variation is really bugging me, it must be some tool setup problem that is creating anti-aliasing in some level or some opacity setting.
Thanks again! I'm surprised this community is so active and helpful, I'll probably learn a lot in here.
IP IP Logged
AlexHW
Commander
Commander
Avatar

Joined: 19 June 2019
Online Status: Offline
Posts: 285
Quote AlexHW Replybullet Posted: 29 October 2013 at 8:39pm
if you're getting anti-aliasing make sure you're using the Pencil tool.. not the Brush tool. (click and hold down the brush tool in the toolbox, and the pencil tool will show).
Also, you can turn off anti-aliasing for if you rotate/resize things by pressing ctrl+k (i think that's right.. or goto preferences).. and make sure the interpolation is set to nearest-neighbor.


Edited by AlexHW - 29 October 2013 at 8:40pm
IP IP Logged
yrizoud
Commander
Commander
Avatar

Joined: 03 May 2021
Location: France
Online Status: Offline
Posts: 342
Quote yrizoud Replybullet Posted: 30 October 2013 at 2:42am
Am I using the wrong software for pixel art?

Yes. What you're looking for is an editor that edits directly in Indexed colors mode.
http://en.wikipedia.org/wiki/Comparison_of_raster_graphics_editors#Color_spaces



Edited by yrizoud - 30 October 2013 at 2:45am
IP IP Logged
Dhanh
Seaman
Seaman
Avatar

Joined: 29 October 2013
Online Status: Offline
Posts: 8
Quote Dhanh Replybullet Posted: 30 October 2013 at 6:01am
Thanks Yrizoud, any suggestions on which one would be the best for game assets? Is there any one of these that can open PSD files?
IP IP Logged
yrizoud
Commander
Commander
Avatar

Joined: 03 May 2021
Location: France
Online Status: Offline
Posts: 342
Quote yrizoud Replybullet Posted: 30 October 2013 at 7:57am
PSD is Photoshop's format and incorporates every new version's changes, so I wouldn't count on being able to edit the same files with a second program in addition to Photoshop. You could lose your adjustment layers, layer hierarchy, "dynamic effects" (I don't remember the name), etc.

Did you notice Photoshop itself already has an "indexed colors" mode ?
http://courses.washington.edu/dmwork/ps_1_lesson_3.html
It's there, though I think it can look quirky because the program is not originally made for it.
Some programs have better palette management functions in general (more functions like reorganize palette as you want, darken or tint a specific range etc.).
"Game assets" is broad, but if you're working with tiles and sprite sheets, a program that can display a not-too-obvious overlay grid can be helpful, and also a snap-to-grid when you want to move tiles/sprites around.

It's difficult to recommend a specific program... Be sure to try one of the free ones to get an idea of the ergonomics of working with indexed colors.
Edit: The list I linked on Wikipedia is actually not very relevant... here's ui's list of pixel art software.
Edit2: Also a 2011 list of software on AGS forums : It's very relevant because this game engine is internally 8-bit indexed-colored, so it's a major concern for game creators there. (But list is outdated because I implemented animation in Grafx2 since then )



Edited by yrizoud - 30 October 2013 at 8:17am
IP IP Logged
AlexHW
Commander
Commander
Avatar

Joined: 19 June 2019
Online Status: Offline
Posts: 285
Quote AlexHW Replybullet Posted: 30 October 2013 at 8:06am
You can edit in indexed color mode with photoshop:
http://help.adobe.com/en_US/photoshop/cs/using/WSfd1234e1c4b69f30ea53e41001031ab64-73eea.html#WSfd1234e1c4b69f30ea53e41001031ab64-73e6a
It might not be as good as other programs, but it's doable.
The main reason to use index color mode is to save memory on the devices that the images will be used on, but most devices these days can handle more so unless you need to use indexed color mode for those purposes, there's not much reason to force yourself to use it in my opinion.

IP IP Logged
yrizoud
Commander
Commander
Avatar

Joined: 03 May 2021
Location: France
Online Status: Offline
Posts: 342
Quote yrizoud Replybullet Posted: 30 October 2013 at 8:33am
Some reasons :
1) Consequence of artistic choice. If the piece is best in 16 well-chosen colors, indexed colors mode will let you fine-tune those 16 colors even after pixelling.
2) Programming tricks : palette swaps for re-coloring a character, illusions of animations by cycling palette entries...
3) No choice for doing tiny animations : animated GIF still rules the web, and it's an indexed color format.

IP IP Logged
Dhanh
Seaman
Seaman
Avatar

Joined: 29 October 2013
Online Status: Offline
Posts: 8
Quote Dhanh Replybullet Posted: 30 October 2013 at 11:08am
Thanks! I´ve tried the indexed color mode on PS but it allows for only one layer and each animated asset has lots of layers, each named appropriately for the asset file (I use a layer to PNG script to export the final version). I guess I'll just have to be really careful so I won´t accidentally create new colors from now on. The color variations are almost unnoticeable but the OCD part of me just wants to find and correct each anomaly in all +500 assets I already made... I just have to let it go and be careful from now on . Any good tutorial on how to setup PS for pixel art and pixel art animations? I´ve done the basics (nearest neibour, anti-alising off, etc...) but those things keep popping up...
IP IP Logged
AlexHW
Commander
Commander
Avatar

Joined: 19 June 2019
Online Status: Offline
Posts: 285
Quote AlexHW Replybullet Posted: 30 October 2013 at 1:23pm
I can probably help you set it up, but you'd have to give specifics on what is causing you the problems.
The only other thing I can think of at the moment is make sure the "Feather" is set to 0px for all your selection tools.

IP IP Logged
Dhanh
Seaman
Seaman
Avatar

Joined: 29 October 2013
Online Status: Offline
Posts: 8
Quote Dhanh Replybullet Posted: 30 October 2013 at 6:09pm
Yep, that was probably it, it has to be adjusted for every tool and I´m using 2 Photoshops (mac and PC), probably I forgot to change some of the tools... . I'll check all tools on both of them... Thanks for the hint!
IP IP Logged
AlexHW
Commander
Commander
Avatar

Joined: 19 June 2019
Online Status: Offline
Posts: 285
Quote AlexHW Replybullet Posted: 30 October 2013 at 8:06pm
no problem!
IP IP Logged
Post Reply Post New Topic
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum