0

I have a grayscale image, which has a certain wanted pattern of colours + some unwanted colors.

The colors I want to leave are (rgb):

000
666
121212
181818
242424
303030
363636
424242

As you can see, there's a pattern. Umfortunately there are some really "hard to select" colors also. The colors are actually contours (curves for height changes of the terrain), so they would be really tiresome to edit manually. The image is 2048 x 2048 pixels.

How could I somehow limit the image just to have those certain colors and maybe even automagically convert the wrong ones to those wanted ones?

Strawberry
  • 33,750
  • 13
  • 40
  • 57
  • Under 'save for web and devices', there are options for defining the palette. – Strawberry Oct 13 '15 at 14:12
  • Thanks for the tip :) Unfortunately I don't know if that's gonna help after all... Here's a small sample of the image. How could I remove the "white" curves and replace those with either colour beside the curve without having to manually draw all the hundreds and hundreds of curves? :/ https://onedrive.live.com/redir?resid=C769995EB0B2279B!43153&authkey=!AKUQouqybVYwUug&v=3&ithint=photo%2cjpg – user161284 Oct 14 '15 at 14:56

1 Answers1

0

You could try converting the image mode to indexed color:

enter image description here

Then choose a custom pallet:

enter image description here

Then add your custom colors to the pallet. Set dither to none. It should convert all colors to the index color they are closest to.

To remove the white lines... convert mode back to rgb, use magic wand to select all white lines (uncheck contiguous and set tolerance to around 10). Then choose select>modify>expand and expand selection by 1 pixel. Now choose edit>fill and choose content-aware.enter image description here

This should fill in the lines with the colors around them. Set color to index again to clean up the blured shape edges.

Hope this helps.

TinMonkey
  • 1,832
  • 1
  • 10
  • 7