Thursday, March 19, 2015

adobe photoshop - How to convert a pattern/photo to a given palette?


How would I convert a photograph or pattern to use only colors from a palette I give it? Is this possible in Photoshop? I think Pic2Color used to do something like this but it's offline...



Answer



Yes it is possible, and very easy to do: Image > Mode > Indexed Color: Here you can switch the Palette to "Custom", pick number of colors in the palette and few other options.


First step is to find how to change the palette





Photoshop will then ask you to flatten the image for the conversion.


Then agree to flatten the image, if it has any.




We have arrived at the crime scene. Here you can change various options, e.g., if you were creating a new palette.


Now this here is the palette selection menu.




For the pre-defined palette, we'll have to go for the topmost option and select "Custom..." to get the file selection menu open.


Pick up the top-most popup menu, and select Custom, for the pre-defined palette.




Photoshop has already generated a suggestion palette for your image, but since we'll be using a pre-defined palette, we'll go for the "Load..." button at the right side of the custom palette menu.



And here you see the contents of the suggested palette and the options to change it.




Now we are dealing with the murded weapon. I have my pre-defined palette here, saved using Photoshop default file format ".ACT". Photoshop also understands .ACO and .PAL - if your palette is in different format, you might enter *.* in the "File name" box and just try to use it (works only if the palette actually is one of these formats but is renamed to avoid abuse or something...) OR convert it to one of the supported formats. (Don't know any tools for that ATM, never had to convert palettes.)


This here is the palette file selection menu.




Now this here is the custom palette I have. One thing to keep in mind as we progress: This palette here is not very suitable for the picture we are using it with. But it demonstrates the change of palette and dither options well. You could manually adjust the colors here by double clicking the representing squares. Useful in case you have to have a #FF00FF for transparency at the index #0 or stuff like that.


My Custom Palette.




You will propably want to adjust the dither options in case the palette you are using doesn't fully support the given image. Options are diffusion, pattern and noise. In the previous picture we were using Diffusion. Here is Pattern:


Dither options picture 1 of 2.





Here is the last option, Noise. I'll stick with this, just because the gradient pleases me the most. If you have a lot of pictures where obvious dithering happens, you might want to keep the same option for the same project for the sake of consistency, but that's up to you.


Dither options picture 2 of 2




Ok, the crime has happened now. The decisions were made and here are the results. If I had chosen, e.g., one of the palettes photoshop suggests me to go with (3rd picture, Local or Master(Perceptual, Selective or Adaptive)) the dithering would be minimal and the change from 24bit colorspace to indexed palette almost unnoticeable (at least for the untrained eye, har har) but since my palette was almost the worst match possible we get to witness the grains of dither:


Close up on the final product.




I hope this helps.


No comments:

Post a Comment

technique - How credible is wikipedia?

I understand that this question relates more to wikipedia than it does writing but... If I was going to use wikipedia for a source for a res...