Hilton Campbell
Hilton Campbell

Reputation: 6095

How to create an art asset that can be dynamically colored in software?

I asked this question on the Graphic Design site, but it includes a programming component that might be better answered here.

Specifically, I have a bunch of photographic crayon images. I would like to remove the color from one to produce a neutral image that I can load into an iPhone app that I'm writing and dynamically color. The crayon images have dark regions (shadows) and light regions (shine) which I would like to preserve. I will be dynamically coloring it with many different colors, ranging from white to rainbow colors to black.

My first inclination is to turn the image into a grayscale image and then somehow turn the color channel into an alpha channel, and change the color of all pixels to black. Then I could use it as a mask. However, this would only preserve the shadows, and I would lose all the highlights.

Any ideas?

Upvotes: 0

Views: 154

Answers (1)

Daniel G. Wilson
Daniel G. Wilson

Reputation: 15055

Two options come to mind:

Make a grayscale version that could be tinted as you said, with the shadows and highlights simply white and gray.

Make an outline, i.e. an image with alpha that had 0% opacity in the colored parts, say 10% white over the highlights, 10% black on the shadows, and 100% black/dark gray for the lines/edges. The idea being that you could put any color under the outline and it would look right.

Upvotes: 1

Related Questions