ra_gif: out of memory error

Hi,

I'm trying to convert radiance image to gif and getting strange error.
command: *ra_gif -n 20 input.hdr output.gif*
error: *ra_gif: out of memory
*output image: *invalid image with size 0

*If I try the same command without -n option no error *
*command: *ra_gif input.hdr output.gif**
*output image: *expected output image*

Other info that may be of use in error source determination

   - Original Radiance image resolution is quite unusual -Y 500 +X 7
   - I've tried to change values of -n option, and for this image options
   n<=5 don't produce error and options n>5 give the same error
   - ra_gif works without problems with any -n option, if I use other image
   with more 'normal' aspect ratio
   - I've tried few ra_gif executables, in Windows and Linux and all give
   the same result.

For -n option in manual there is a description:
"The *-n* option specifies a sampling factor for neural network color
quantization. This value should be between 1 and 80, where 1 takes the
longest and produces the best results in small areas of the image."
So I've chosen 20, as some optimal value to get good gif images and not too
long time.
I thought that lower -n values would require more memory, but in this case
they give correct results, and higher values give memory error.

Not sure what can be the source of the problem.

Any ideas?
Marija

The -n option of ra_gif is just to save time on large images by subsampling the input pixels. For small images, setting -n 1 should produce the best results, so there's no reason to set the option higher. If you don't have enough samples, the neural network color quantizer doesn't have enough information and I guess it loses its mind...

-Greg

···

From: Marija Velickovic <[email protected]>
Date: May 16, 2012 6:38:01 AM PDT

Hi,

I'm trying to convert radiance image to gif and getting strange error.
command: ra_gif -n 20 input.hdr output.gif
error: ra_gif: out of memory
output image: invalid image with size 0

If I try the same command without -n option no error
command: ra_gif input.hdr output.gif
output image: expected output image

Other info that may be of use in error source determination
Original Radiance image resolution is quite unusual -Y 500 +X 7
I've tried to change values of -n option, and for this image options n<=5 don't produce error and options n>5 give the same error
ra_gif works without problems with any -n option, if I use other image with more 'normal' aspect ratio
I've tried few ra_gif executables, in Windows and Linux and all give the same result.
For -n option in manual there is a description:
"The −n option specifies a sampling factor for neural network color quantization. This value should be between 1 and 80, where 1 takes the longest and produces the best results in small areas of the image."
So I've chosen 20, as some optimal value to get good gif images and not too long time.
I thought that lower -n values would require more memory, but in this case they give correct results, and higher values give memory error.

Not sure what can be the source of the problem.

Any ideas?
Marija
_______________________________________________
Radiance-general mailing list
[email protected]
http://www.radiance-online.org/mailman/listinfo/radiance-general

Thanks Greg,

In fact for input Radiance model I generate automatically big number of
images in my program, and can't say in advance what would be the size of
any image.
-n 1 is definitely the safest solution (although in my case also
calculation time is important - since numerous images).

Thanks for answer anyway, because it is now clear why I get error messages.

Marija

···

On Wed, May 16, 2012 at 7:59 PM, Greg Ward <[email protected]> wrote:

The -n option of ra_gif is just to save time on large images by
subsampling the input pixels. For small images, setting -n 1 should
produce the best results, so there's no reason to set the option higher.
If you don't have enough samples, the neural network color quantizer
doesn't have enough information and I guess it loses its mind...

-Greg

Well, I think the neural network needs at least 300 pixel samples to do its work, meaning that the total number of pixels divided by the -n option must be at least 300. Even with -n 1, it can fail if you only give it an image that's a couple of hundred pixels in size. I don't think the other converters are so constrained. You could use ra_bmp which does tone-mapping also, or ra_t8 if you really want an 8-bit image.

Best,
-Greg

···

From: Marija Velickovic <[email protected]>
Date: May 17, 2012 1:26:01 AM PDT

Thanks Greg,

In fact for input Radiance model I generate automatically big number of images in my program, and can't say in advance what would be the size of any image.
-n 1 is definitely the safest solution (although in my case also calculation time is important - since numerous images).

Thanks for answer anyway, because it is now clear why I get error messages.

Marija

On Wed, May 16, 2012 at 7:59 PM, Greg Ward <[email protected]> wrote:
The -n option of ra_gif is just to save time on large images by subsampling the input pixels. For small images, setting -n 1 should produce the best results, so there's no reason to set the option higher. If you don't have enough samples, the neural network color quantizer doesn't have enough information and I guess it loses its mind...

-Greg