How I do a relieve image ?

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Post Reply
dri
Posts: 3
Joined: 2013-11-25T05:38:44-07:00
Authentication code: 6789

How I do a relieve image ?

Post by dri »

Hello guys,m can you helpme please?

From this image
Image

To this
Image

The idea is to put the relieve over other equal images with color
Last edited by dri on 2013-11-28T01:01:16-07:00, edited 1 time in total.
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: How I do a relieve image?

Post by fmw42 »

try


convert 52934d34f0c97.png -alpha extract \
-shade 90x45 -fuzz 0.5% -transparent "gray(180)" \
-channel a -evaluate multiply 0.5 +channel result.png


adjust the multiply factor to give the relief more or less contrast
dri
Posts: 3
Joined: 2013-11-25T05:38:44-07:00
Authentication code: 6789

Re: How I do a relieve image?

Post by dri »

Thanks for your answer, but:

The effect is similar but is outside the original layer.
I need the effect inside original layer. Inside, over the white color.

How I do this?


fmw42 wrote:try


convert 52934d34f0c97.png -alpha extract \
-shade 90x45 -fuzz 0.5% -transparent "gray(180)" \
-channel a -evaluate multiply 0.5 +channel result.png


adjust the multiply factor to give the relief more or less contrast
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: How I do a relieve image?

Post by fmw42 »

Try this. Adjust the morphology erode octagon:1 value as desired to increase the erosion until it suits your requrements). If octagon:1 is too much, start with diamond:1.



convert 52934d34f0c97.png -alpha extract -morphology erode octagon:1 \
-shade 90x45 -fuzz 0.5% -transparent "gray(180)" \
-channel a -evaluate multiply 0.5 +channel result.png
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: How I do a relieve image?

Post by snibgo »

It could be done with "-shadow" or more generally with "-blur". But I see the required result has white pixels with varying transparency, and transparent black elsewhere, so it's quite fiddly.
snibgo's IM pages: im.snibgo.com
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: How I do a relieve image?

Post by snibgo »

This Windows script is close to the desired result.

Code: Select all

convert ^
  52934d34f0c97.png ^
  -alpha extract ^
  -negate ^
  ( -clone 0 ^
    -blur 3x1.5 ^
  ) ^
  -geometry +0+2 ^
  -compose Lighten -composite ^
  -fill Black -opaque White ^
  -channel RGB -evaluate Multiply 0.66 ^
  -alpha Copy ^
  -channel RGB -evaluate set 100%% ^
  e9.png
The main difference is that the desired result has not only pure whites of varying transparency, but also dark pixels of very low transparency.
snibgo's IM pages: im.snibgo.com
dri
Posts: 3
Joined: 2013-11-25T05:38:44-07:00
Authentication code: 6789

Re: How I do a relieve image?

Post by dri »

snibgo thanks for your effort, you help me a lot.

I tryed your examples and I search the combination of both :_(

The effect I need is exactly your first example, but applied over an image as the second example. The central gray color is the problem.

Like this image. The white lighting and the shadow dark, produce a good 3d effect
Image
Post Reply