transparency in printim
Kevin M Levey
klevey at CUSTOMWEATHER.COM
Wed Mar 4 11:28:42 EST 2009
Just as an FYI to other GRADS users:
convert is an Imagemagick command and must be installed on your system
for this command to work!
Regards,
Kevin M Levey, MSc in Oceans and Atmospheric Sciences (University of
Cape Town)
Director of Meteorological Operations
CustomWeather, Inc.
San Francisco, California, USA
"Taking the World by Storm!"
http://www.customweather.com
http://www.myforecast.com
http://www.1stweather.com
cell: 415-794-0411
work: 415-777-3566
email: klevey at customweather.com
On Mar 4, 2009, at 03/04/09 - 6:30 AM, Bernd Becker wrote:
> Thanks Jennifer and Patrick!
>
> Patrick Reuter came up with a solution!
>
>
>
> after all the rigmarole described in the e-mail below,
> one further step does deliver the intended result:
>
> '!convert -transparent black pop.png pop.png'
>
>
> On Wed, 2009-03-04 at 08:56 -0500, Jennifer Adams wrote:
>> Hi, Bernd --
>> I do not have an answer for this problem. I created images with a
>> transparent color that many applications including Photoshop,
>> Preview,
>> Safari, and Firefox all treat properly, but Google Earth ... does not
>> get it right. I have also created images that Google Earth does get
>> right (the transparent color is indeed transparent and the background
>> shows through), but I have not been able to figure out what the key
>> difference is between these images. My GrADS scripts are essentially
>> the same and so is the KML. After spending a frustrating afternoon
>> figuring out these things, I stopped playing with Google Earth and
>> went back to work on something else.
>> --Jennifer
>>
>> On Mar 4, 2009, at 7:07 AM, Bernd Becker wrote:
>>
>>> Hello,
>>>
>>>
>>> to create images to be shown on google earth, I would like to
>>> create shaded contour plots and contours and symbols all in one png
>>> file.
>>>
>>> The areas, where nothing is shown in the image, I would like to be
>>> transparent to see whatever google earth puts underneath.
>>>
>>> I do:
>>>
>>> 'set parea 0 11 0 8.5'
>>> 'set grid off'
>>> 'set mproj scaled'
>>> 'set x 0.5 321.5 '
>>> 'set y 0.5 161.5 '
>>> 'set mpdraw off'
>>> 'set grads off'
>>> 'set frame off'
>>>
>>> clevels =' -0.9 -0.5 -0.2 -0.1 0.1 0.2 0.5 0.9 '
>>>
>>> 'set cstyle 2 '
>>> 'set ccolor 1 '
>>> 'set cthick 1'
>>> 'set black 'subwrd(clevels,4)' 'subwrd(clevels,5)
>>> *'set gxout shaded'
>>> 'set gxout grfill'
>>> 'set clevs 'clevels
>>> 'set ccols 14 4 11 5 0 16 7 12 2 '
>>> 'set black 'subwrd(clevels,4)' 'subwrd(clevels,5)
>>>
>>>
>>> 'd v7 - v6'
>>>
>>>
>>> 'set gxout shaded'
>>> 'set clevs 'clevels
>>> 'set ccols 14 4 11 5 0 16 7 12 2 '
>>> 'set black 'subwrd(clevels,4)' 'subwrd(clevels,5)
>>> 'd maskout((v8-v6),v1-23.)'
>>>
>>>
>>> 'set gxout shaded'
>>> 'set gxout contour'
>>> 'set cthick 1'
>>> 'set ccols 12 2 '
>>> 'set ccols 80 80 48 '
>>> 'set clab off'
>>> 'set clevs 'thresh
>>> 'd v5'
>>>
>>>
>>> printim pop.png x320 y160 -t 1
>>>
>>>
>
> '!convert -transparent black pop.png pop.png'
>
>>> Here I am uncertain about which colour code to use:
>>> the colour number currently set in grads?
>>> the current color code from the X server?
>>>
>>> How can I ascertain, that the regions set to "black"
>>> by 'set black'
>>> are transparent in the png file?
>>>
>>> These areas are shown as black, so "-t 1" should do the trick,
>>> but google earth shows the areas as black, opaque.
>>>
>>> What should I do?
>
> '!convert -transparent black pop.png pop.png'
>
>>> Many thanks,
>>> Bernd.
>>>
>>> --
>>> Bernd Becker The Monthly Outlook
>>> Met Office FitzRoy Road Exeter Devon EX1 3PB United Kingdom
>>> Tel.: +44 (0) 1392 884511 Fax: +44 (0)870 900 5050
>>> E-mail:bernd.becker at metoffice.com - http://www.metoffice.com
>>>
>>
>> --
>> Jennifer M. Adams
>> IGES/COLA
>> 4041 Powder Mill Road, Suite 302
>> Calverton, MD 20705
>> jma at cola.iges.org
>>
>>
>>
>>
>>
>>
> --
> Bernd Becker The Monthly Outlook
> Met Office FitzRoy Road Exeter Devon EX1 3PB United Kingdom
> Tel.: +44 (0) 1392 884511 Fax: +44 (0)870 900 5050
> E-mail:bernd.becker at metoffice.com - http://www.metoffice.com
More information about the gradsusr
mailing list