Welcome, Guest. Please Login.
OpenDX User Forum
05/23/13 at 03:38:45
News: Quality paid support available from Visualization and Imagery Solutions


Pages: 1
WriteImage image quality (Read 5730 times)
cloudvis
Forum Newbie
*


Got Viz?

Posts: 17
WriteImage image quality
09/30/09 at 11:48:14
 
I use WriteImage to save pictures of weather satellite data, and the problem is that no matter which of the file formats I select, the quality is dramatically lower than the pictures I can get from just taking a snapshot of the DX display from my screen. Since I create thousands of pictures, I cannot manually snapshot them all and must use an automated method for the output. So my questions are as follows:
 
1. Has anyone else noticed a lower image quality in their pictures or think it is substandard for their application ?
2. Might anyone know how to manipulate the WriteImage code to compensate somehow, like maybe to adjust the contrast or color range ? Or have their own code with similar functionality but more flexibility, etc. ?
3. Might anyone have suggestions on how to interface a DX .net that is run in batch or script mode (repetitively creates images based on updated data and displays them to the screen) with automated screen capture software ?
 
Many thanks for any input !
I would be eternally grateful !
< undecidedSharon G>
Back to top
 
 
Email   IP Logged
joelr
OpenDX Forum Administrator
*****


Got Viz?

Posts: 388
Re: WriteImage image quality
Reply #1 - 09/30/09 at 13:03:55
 
I have never noticed any difference in image quality using WriteImage, although
I do have to adjust the gamma. What differences are you seeing? Can you post
a sample?
Back to top
 
 
Email   IP Logged
cloudvis
Forum Newbie
*


Got Viz?

Posts: 17
Re: WriteImage image quality
Reply #2 - 10/06/09 at 10:22:56
 
The greatest difference seems to be in areas of yellow and blue, where the image gets washed out or saturated.
 
I have found a pretty good fix by tinkering in Image Magick with +sigmoidal-contrast and -modulate (to adjust hue and saturation). However I am still a little disillusioned as to why this is necessary.  
 
Do you use Image Magick to adust the gamma ? I am curious, how much adjustment is needed ?
 
Hopefully my sample attachment will come through.
Back to top
tiff_sample.png (attachment deleted)  
 
Email   IP Logged
cloudvis
Forum Newbie
*


Got Viz?

Posts: 17
Re: WriteImage image quality
Reply #3 - 10/06/09 at 10:33:05
 
A better picture...
Back to top
tiff_sample1.png (attachment deleted)  
 
Email   IP Logged
joelr
OpenDX Forum Administrator
*****


Got Viz?

Posts: 388
Re: WriteImage image quality
Reply #4 - 10/06/09 at 11:26:46
 
You can set gamma and other parameters as part of the format parameter to WriteImage.
E.g.,
    WriteImage( ... format="ImageMagick supported format gamma=1", ...)
 
See WriteImage documentation page.  
 
The default gamma is 2 - don't know why. If you set gamma=1, your colors should be fine.
I verified this with the image you posted. I read it in, and wrote it back out. Without
setting gamma, the result is washed out. Setting gamma to 1 preserved the colors.
 
 
Cheers,
Joel
Back to top
 
 
Email   IP Logged
cloudvis
Forum Newbie
*


Got Viz?

Posts: 17
Re: WriteImage image quality
Reply #5 - 10/28/09 at 07:37:37
 
Problem solved. Thanks. I wish I had written to you 10 years ago. I use the VPE and didn't see any inputs to change anything such as gamma in WriteImage. I think maybe I interpreted the documentation (long ago when I looked... and now it doesn't even exist as server is not supported ?) as referring only to use of the scripting language.
 
So now I need to ask, what is the advantage of using ImageMagick supported format ? I tried your trick with both Tiff (which is what I had been using) and ImageMagick supported format. The results for both seemed comparably good, but the ImageMagick one had a much larger file size. I already do use ImageMagick on the Tiff to convert to JPG (to further reduce size), so there is no compatibility issue there.
Back to top
 
 
Email   IP Logged
joelr
OpenDX Forum Administrator
*****


Got Viz?

Posts: 388
Re: WriteImage image quality
Reply #6 - 10/28/09 at 08:32:42
 
"ImageMagick supported format" is just the generic format to specify when  
you want to write an image in some format (e.g., jpg, png, gif, etc.) other than  
the builtin defaults (which includes tiff).
Back to top
 
 
Email   IP Logged
Pages: 1