Missing value and Image size in Image, Function Graphic [message #87083] |
Mon, 06 January 2014 13:20  |
Gompie
Messages: 76 Registered: August 2012
|
Member |
|
|
Hi
I am using image function graphic. I want to achieve the effect of
cgimage,2d_array, missing_value=0,missing_color='white
in image function. How do I do that?
I tried
img = IMAGE(rcounts, RGB_TABLE=33, TITLE=TTITLE,min_value=0) but it does not work.
Second I do I make the size of plotted image bigger so that it looks similar to what i get when i plot using cgimage.
This makes the color of missing values white.
Gompie.
|
|
|
Re: Missing value and Image size in Image, Function Graphic [message #87084 is a reply to message #87083] |
Mon, 06 January 2014 13:54   |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
Gompie writes:
> I am using image function graphic. I want to achieve the effect of
>
> cgimage,2d_array, missing_value=0,missing_color='white
>
> in image function. How do I do that?
>
> I tried
> img = IMAGE(rcounts, RGB_TABLE=33, TITLE=TTITLE,min_value=0) but it does not work.
>
> Second I do I make the size of plotted image bigger so that it looks similar to what i get when i plot using cgimage.
>
> This makes the color of missing values white.
I've been mulling over the idea of a Kickstarter campaign to build a
simple graphics system using object graphics that works in the intuitive
way Coyote Graphics routines work. Would anyone be interested in such a
thing?
Cheers,
David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.idlcoyote.com/
Sepore ma de ni thue. ("Perhaps thou speakest truth.")
|
|
|
|
Re: Missing value and Image size in Image, Function Graphic [message #87086 is a reply to message #87085] |
Mon, 06 January 2014 21:25   |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
Gompie writes:
> When I use
> set_plot, 'ps'
> !p.font=0
> device, filename='fig_better.eps', encapsulated=1, /helvetica
>
> I get the following error
> CGIMAGE: An AlphaBackgroundImage is required to create transparent images in PostScript.
>
> Anyideas...
Sure. When you use the MISSING_VALUE and MISSING_COLOR keywords you are
using image transparency. To do transparency, you need two 24-bit
images. You give me one with cgImage and if you are using the graphics
window, I can obtain the other, the background image, from the window.
But, when I am in the PostScript device I have no way of obtaining the
background image, so you have to give it to me with the
AlphaBackgroundImage keyword.
http://www.idlcoyote.com/cg_tips/transimage.php
Cheers,
David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.idlcoyote.com/
Sepore ma de ni thue. ("Perhaps thou speakest truth.")
|
|
|
Re: Missing value and Image size in Image, Function Graphic [message #87091 is a reply to message #87084] |
Tue, 07 January 2014 05:47   |
Paul Van Delst[1]
Messages: 1157 Registered: April 2002
|
Senior Member |
|
|
The "CGF" graphics system? Or "CFG"?
I like the idea of that. I'm getting tired of wrestling with the
minutiae of standard FG (mostly because I forget what I learned last
time...).
It's also something that companies can be convinced to contribute to
when they are told how it will help productivity - which can be their
reward... doesn't hurt for bid+proposal PR either :o) The more plebian
contributors might have to do with a monogrammed coffee cup.
On 01/06/14 16:54, David Fanning wrote:
> Gompie writes:
>
>> I am using image function graphic. I want to achieve the effect of
>>
>> cgimage,2d_array, missing_value=0,missing_color='white
>>
>> in image function. How do I do that?
>>
>> I tried
>> img = IMAGE(rcounts, RGB_TABLE=33, TITLE=TTITLE,min_value=0) but it does not work.
>>
>> Second I do I make the size of plotted image bigger so that it looks similar to what i get when i plot using cgimage.
>>
>> This makes the color of missing values white.
>
> I've been mulling over the idea of a Kickstarter campaign to build a
> simple graphics system using object graphics that works in the intuitive
> way Coyote Graphics routines work. Would anyone be interested in such a
> thing?
>
> Cheers,
>
> David
>
|
|
|
Re: Missing value and Image size in Image, Function Graphic [message #87095 is a reply to message #87086] |
Tue, 07 January 2014 08:06   |
Gompie
Messages: 76 Registered: August 2012
|
Member |
|
|
Hi David,
Following your advice on AlphaBackgroundImage, I tried with the following commands.
set_plot, 'ps'
!p.font=0
device, filename='fig_better.ps', encapsulated=1, /helvetica
cgImage, cgDemoData(7), CTIndex=0, XRange=[0,500], YRange=[0,500], Margin=0.1,outfile='test.png',output='png', /Save
cgImage, cgDemoData(5),AlphaBackgroundImage='test.png', CTIndex=33, Transparent=30, XRange=[50,250], YRange=[250,450], /Overplot
But get the error unexpected dimensions of background Image. I tried with different formats (gif ps etc) of Alphaimage but got the same message.
Can you help.
GlanPlon
|
|
|
Re: Missing value and Image size in Image, Function Graphic [message #87097 is a reply to message #87095] |
Tue, 07 January 2014 08:22   |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
Gompie writes:
> Following your advice on AlphaBackgroundImage, I tried with the following commands.
>
> set_plot, 'ps'
> !p.font=0
> device, filename='fig_better.ps', encapsulated=1, /helvetica
>
> cgImage, cgDemoData(7), CTIndex=0, XRange=[0,500], YRange=[0,500], Margin=0.1,outfile='test.png',output='png', /Save
>
> cgImage, cgDemoData(5),AlphaBackgroundImage='test.png', CTIndex=33, Transparent=30, XRange=[50,250], YRange=[250,450], /Overplot
>
> But get the error unexpected dimensions of background Image. I tried with different formats (gif ps etc) of Alphaimage but got the same message.
Well, uh, the parameter you are passing needs to be an *image*, not the
name of a file containing an image. :-)
Generally, you would get the background image like this, before you set
up the PostScript device:
backgroundImage = cgSnapshot()
ps_open, 'test.png'
cgimage, ...., AlphaBackgroundImage = backgroundImage
ps_close
You can find other examples in the Coyote Plot Gallery:
http://www.idlcoyote.com/gallery/index.html#MULTIPSTRANSPARE NT
Cheers,
David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.idlcoyote.com/
Sepore ma de ni thue. ("Perhaps thou speakest truth.")
|
|
|
Re: Missing value and Image size in Image, Function Graphic [message #87098 is a reply to message #87097] |
Tue, 07 January 2014 08:37   |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
David Fanning writes:
> Generally, you would get the background image like this, before you set
> up the PostScript device:
>
> backgroundImage = cgSnapshot()
> ps_open, 'test.png'
> cgimage, ...., AlphaBackgroundImage = backgroundImage
> ps_close
Whoops! Still getting used to my own software. Blush...
backgroundImage = cgSnapshot()
cgps_open, 'test.png'
cgimage, ...., AlphaBackgroundImage = backgroundImage
cgps_close
Cheers,
David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.idlcoyote.com/
Sepore ma de ni thue. ("Perhaps thou speakest truth.")
|
|
|
|
Re: Missing value and Image size in Image, Function Graphic [message #87100 is a reply to message #87099] |
Tue, 07 January 2014 09:32   |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
superchromix writes:
> I would fund such a project.. Quite a formidable task though.
It would be a fairly big project, but I actually think I have many of
the parts laying around here. The graphics part of it, I think, will be
fairly trivial and routine. The parts you have to get right are the
window controller and the layout controller. I have some ideas on how
those parts can be made as simple as possible.
The danger with objects is always complexity. It is easy to get way too
cute and ambitious. Simple, simple, simple is my motto. I think this is
the only way object graphics are going to be used by the masses.
And then, of course, there is always the question of who the hell is
going to pay you for spending all your time doing such a thing. That's
the part I've never been any good at. :-)
Cheers,
David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.idlcoyote.com/
Sepore ma de ni thue. ("Perhaps thou speakest truth.")
|
|
|
Re: Missing value and Image size in Image, Function Graphic [message #87101 is a reply to message #87100] |
Tue, 07 January 2014 10:09   |
Andy Sayer
Messages: 127 Registered: February 2009
|
Senior Member |
|
|
I would back it, although as it would almost certainly have to be from my own personal cash than any institutional backing it would be of the order of bucks rather than megabucks. :)
On Tuesday, January 7, 2014 12:32:39 PM UTC-5, David Fanning wrote:
> superchromix writes:
>
>
>
>> I would fund such a project.. Quite a formidable task though.
>
>
>
> It would be a fairly big project, but I actually think I have many of
>
> the parts laying around here. The graphics part of it, I think, will be
>
> fairly trivial and routine. The parts you have to get right are the
>
> window controller and the layout controller. I have some ideas on how
>
> those parts can be made as simple as possible.
>
>
>
> The danger with objects is always complexity. It is easy to get way too
>
> cute and ambitious. Simple, simple, simple is my motto. I think this is
>
> the only way object graphics are going to be used by the masses.
>
>
>
> And then, of course, there is always the question of who the hell is
>
> going to pay you for spending all your time doing such a thing. That's
>
> the part I've never been any good at. :-)
>
>
>
> Cheers,
>
>
>
> David
>
>
>
> --
>
> David Fanning, Ph.D.
>
> Fanning Software Consulting, Inc.
>
> Coyote's Guide to IDL Programming: http://www.idlcoyote.com/
>
> Sepore ma de ni thue. ("Perhaps thou speakest truth.")
|
|
|
|