0

We have the following PSD https://app.box.com/s/rf514j3wnic1xkt6y1q3b5qnk0zds2rl

This is a transparent PSD with one base layer for the ring metal.

And additional layer for each individual stones.

Something like https://app.box.com/s/i8lhshbl27pvjmmczjq2bhla4mzw9cwn and this

We want to be able to apply tint to each individual stone layer based of user input and export the final image as PNG file. To provide users the ability to design the ring to their liking.

Now I am trying to figure out what is the best way to achieve this functionality ?

We would like the image generated server side in .net so it can be shared.

What is the best way to approach this. I am thinking of using an image library like imagemagick to convert the image. But I am unable to locate any examples where you can alter multiple layer with in a PSD file before converting it to another file format.

Any example or suggestion on methods to achieve this will of great help.

Darsh
  • 1

1 Answers1

1

Editing layered PSD files is not going to be easy. I would suggest you maybe save the ring and each of the gemstone layers as a separate PNG file. Then you can do something along these lines with ImageMagick:

#!/bin/bash
convert ring.png                            \
   \( layer-1.png \( +clone +level-colors red       \) -compose Multiply   -composite \) -compose overlay -composite \
   \( layer-2.png \( +clone +level-colors green     \) -compose VividLight -composite \) -compose overlay -composite \
   \( layer-3.png \( +clone +level-colors blue      \) -compose LinearBurn -composite \) -compose overlay -composite \
   \( layer-4.png \( +clone +level-colors "#ffff00" \) -compose Saturate   -composite \) -compose overlay -composite \
   result.png

Giving you a PNG file like this:

enter image description here

You may like to experiment with the blending modes, I just tried a few that looked vaguely pleasing to my eye. If you want a list of all available blending modes, you can do:

identify -list compose
Atop
Blend
Blur
Bumpmap
ChangeMask
Clear
ColorBurn
ColorDodge
Colorize
CopyBlack
CopyBlue
CopyCyan
CopyGreen
Copy
CopyMagenta
CopyOpacity
CopyRed
CopyYellow
Darken
DarkenIntensity
DivideDst
DivideSrc
Dst
Difference
Displace
Dissolve
Distort
DstAtop
DstIn
DstOut
DstOver
Exclusion
HardLight
HardMix
Hue
In
Lighten
LightenIntensity
LinearBurn
LinearDodge
LinearLight
Luminize
Mathematics
MinusDst
MinusSrc
Modulate
ModulusAdd
ModulusSubtract
Multiply
None
Out
Overlay
Over
PegtopLight
PinLight
Plus
Replace
Saturate
Screen
SoftLight
Src
SrcAtop
SrcIn
SrcOut
SrcOver
VividLight
Xor

I also specified some colours by name and one by hex, so you can see how to do it that way if you prefer.

P.S. If you keep all your artwork as PSD files, you can always use Adobe's ExtendScript to script the export of the various layers as separate PNG files with a single keypress...

P.P.S. It is possible for ImageMagick to extract the layers from a PSD file itself, but I extracted the layers from your file and they are not all the same size as the background image and I cannot find their correct positioning relative to it. If you know something about how the layers were created and whether they could be made identical size and aligned with the background, you could replace layer-n.png in my examples with PhotoshopFile.psd[n]

P.P.P.S. If you want to do this server side in .NET you should take a look at the .NET library for ImageMagick that can be found here: https://magick.codeplex.com/. If you need help translating the commands above to C# you could ask a question on the discussions page there.

dlemstra
  • 7,813
  • 2
  • 27
  • 43
Mark Setchell
  • 191,897
  • 31
  • 273
  • 432