Creating glass bubble

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
Marcel71
Posts: 49
Joined: 2011-04-13T13:57:34-07:00
Authentication code: 8675308

Creating glass bubble

Post by Marcel71 »

First thanks fmw42 for answering my previous question :)

What i am trying to create now is something like the following:
http://www.imagemagick.org/Usage/thumbn ... hading.png

But then with this image:
http://www.imagemagick.org/Usage/thumbn ... ghting.png

That the gray part is gone and it is transparent like the badge_shading.

I was reading this topic:
viewtopic.php?f=1&t=19337

But because i don't see the starting images i can't see the result. I tried it with the following images, but it did not work:
http://www.imagemagick.org/Usage/thumbn ... hading.png
http://www.imagemagick.org/Usage/thumbn ... l_mask.png

Any help would be appriciated.

Regards,
Marcel
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Creating glass bubble

Post by fmw42 »

see http://www.imagemagick.org/Usage/thumbn ... mask_paint

Just create a white round rectangle the same as the white circle and process using the appropriate part of the commands given. You can create a white round rectangle using -draw. See http://www.imagemagick.org/Usage/draw/#primitives
Marcel71
Posts: 49
Joined: 2011-04-13T13:57:34-07:00
Authentication code: 8675308

Re: Creating glass bubble

Post by Marcel71 »

Hi fmw42,

In that example they create a button from an image, using a pre-made glass button and a white circle.
What i want to make the transparent glass button with imagemagick.

Regards,
Marcel
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Creating glass bubble

Post by fmw42 »

It was premade in Photoshop and I do not know how. See viewtopic.php?f=1&t=19116
User avatar
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Re: Creating glass bubble

Post by anthony »

You also need to be sure that for the gray lighting mask a perfect 50% gray values means no shading.
I have not looked at how the new colorspace handling effects these examples. Idealy it shouldn't as colorspace handle should not change the values in an image UNLESS specific requested or required.

I did not create the badge image, I downloaded it from the images submited to the forum topic composite overlay and masking. Just the one source image generated all the various masks (using the commands given in the forum topic). The only thing I added was a circle mask to separate background/shadow areas from the internal glass areas, which often needed slightly different processing to convert between masking styles.

If you understand how each of the methods work, it is fairly straight forward to do the convertion, though as I mentioned some styles generate nicer looking masking images than others, especially with things like shadows (which requires a black background color) than others.

It is also often easier to generate your own shading masks directly than convert them, using methods such as used to generate the 'glass button'.
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
User avatar
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Re: Creating glass bubble

Post by anthony »

The Aqua Shading is probably one of the better 'glass like' shading methods.
http://www.imagemagick.org/Usage/advanced/#aqua_effects

But you may like the 'Gel' effect instead
http://www.imagemagick.org/Usage/advanced/#gel_effects

Other effects are also posible.

You may also like to look at the use of 'shade' for sphere/bubble surface (not glass) effects
I generated a lot of more and more complex examples of this, as it was so central to many other effects.
http://www.imagemagick.org/Usage/transform/#shade

What I have not explored much is the use of distance gradients (with anti-aliasing)
http://www.imagemagick.org/Usage/morpho ... anti-alias
This should really become a separate special but standard function, much like 'shade' is.

Combining shade and distance in various ways should generate almost any highlight effect you care to name, but I have not explored it myself.

Please contribute.
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
Post Reply