[yt-users] Issue regarding Volume Rendering

Nathan Goldbaum nathan12343 at gmail.com
Tue Oct 6 13:17:08 PDT 2015


Ah, sorry, I was going off of the annotation you had above your images, not
the code in your e-mail.

I'm not sure what's causing this difference. It might be due to different
handling of the alpha channels? The easiest way to find where the
difference is happening would be to look at the implementations of these
two functions.

Sorry I couldn't give you a better answer.

On Tue, Oct 6, 2015 at 3:11 PM, Reju Sam John <rejusamjohn at gmail.com> wrote:

> Hi Nathan,
>
> But I was using clip_ratio =4 for both save_image() and show() as below
>
> cam.save_image(image, clip_ratio=4, transparent=False)
>
> cam.show(clip_ratio=4)
>
>
> On Tue, Oct 6, 2015 at 8:41 PM, Nathan Goldbaum <nathan12343 at gmail.com>
> wrote:
>
>> Th save_image function also takes a clip_ratio keyword argument. This
>> keyword is used to "clip" pixels that have much higher intensity contrast
>> than the test of the image, producing more pleasing histogram equalization.
>> I'd suggest supplying clip_ratio to save_image as well.
>>
>> -Nathan
>>
>> On Tue, Oct 6, 2015 at 8:43 AM, Reju Sam John <rejusamjohn at gmail.com>
>> wrote:
>>
>>>
>>> Hi all,
>>>
>>> I am trying to do some volume rendering with the following script.
>>>
>>>
>>>     tf = yt.ColorTransferFunction((-29, -24))
>>>     tf.add_layers(4, w=0.01)
>>>     cam = ds.camera([5.020844896e-01, 4.934331785e-01, 4.921018057e-01],
>>> [0.0, 0.0, 1.0], (20, 'Mpc'), 640, tf, fields=["density"],
>>> log_fields="False", no_ghost=False)
>>>     image = cam.snapshot(fn="density_vol_"+fn_i+".png")
>>>     cam.save_image(image, clip_ratio=4, transparent=False)
>>>     cam.show(clip_ratio=4)
>>>
>>>
>>>
>>> But the problem is that the image saved using cam.save_image() is
>>> different from the one displayed by  cam.show(clip_ratio=4)
>>>
>>> Displayed image using cam.show(clip_ratio=4)
>>>>>>  download.png
>>> <https://drive.google.com/file/d/0B6l5iRWTUbHWa054VDVNOFY1bGpqVklqYlA3ZEhzazhwZWhr/view?usp=drive_web>
>>>>>> Saved image using cam.save_image()
>>>>>>  density_vol_10.png
>>> <https://drive.google.com/file/d/0B6l5iRWTUbHWUmhXVGZfY0xiMXBGUW81Szh0LU0yZFI5enFB/view?usp=drive_web>
>>>>>>
>>> Why this is happening ? How to save the same image as of displayed one?
>>>
>>>  Thank you
>>>
>>> Reju Sam John
>>>
>>>
>>>
>>> --
>>> Reju Sam John
>>>
>>> _______________________________________________
>>> yt-users mailing list
>>> yt-users at lists.spacepope.org
>>> http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
>>>
>>>
>>
>> _______________________________________________
>> yt-users mailing list
>> yt-users at lists.spacepope.org
>> http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
>>
>>
>
>
> --
> Reju Sam John
>
> _______________________________________________
> yt-users mailing list
> yt-users at lists.spacepope.org
> http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.spacepope.org/pipermail/yt-users-spacepope.org/attachments/20151006/d3ffd956/attachment.html>


More information about the yt-users mailing list