comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Re: write_png weirdness
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
Re: write_png weirdness [message #51506] Thu, 23 November 2006 12:33
Bringfried Stecklum is currently offline  Bringfried Stecklum
Messages: 75
Registered: January 1996
Member
F�LDY Lajos wrote:
>
> On Thu, 23 Nov 2006, Bringfried Stecklum wrote:
>
>> Hello,
>>
>> I noticed that in IDL 6.1.1 there is some weirdness related to the
>> write_png procedure. I have true colour image like
>>> print,size(hhh)
>>> 3 3 640 512 1 983040
>> which I want to save as a negative. However,
>>
>> write_png,'file',255-hhh
>>
>> results in a PNG file which is just black while
>>
>> write_png,'file',byte(255-hhh)
>>
>> does the right thing. This seems a bit strange since both, hhh and 255
>> are of type byte, and so should be the difference (without forcing it).
>
> 255 is INT (255b is BYTE).
>
> regards,
> lajos
>
Uhmm, again the type trap.Seems I was not fully awake yet. Thanks for
pointing out the obvious.

regards,

Bringfried
Re: write_png weirdness [message #51523 is a reply to message #51506] Thu, 23 November 2006 01:40 Go to previous message
Foldy Lajos is currently offline  Foldy Lajos
Messages: 268
Registered: October 2001
Senior Member
On Thu, 23 Nov 2006, Bringfried Stecklum wrote:

> Hello,
>
> I noticed that in IDL 6.1.1 there is some weirdness related to the write_png
> procedure. I have true colour image like
>> print,size(hhh)
>> 3 3 640 512 1 983040
> which I want to save as a negative. However,
>
> write_png,'file',255-hhh
>
> results in a PNG file which is just black while
>
> write_png,'file',byte(255-hhh)
>
> does the right thing. This seems a bit strange since both, hhh and 255 are of
> type byte, and so should be the difference (without forcing it).

255 is INT (255b is BYTE).

regards,
lajos
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Re: Expanding array with counts from another array
Next Topic: Pair Counts in an Annulus, for large data sets

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Sat Oct 11 08:05:25 PDT 2025

Total time taken to generate the page: 1.12349 seconds