Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

image size defined with Session.set_view_area from retina and non-retina display #85

Open
kswang1029 opened this issue Mar 20, 2023 · 0 comments

Comments

@kswang1029
Copy link
Contributor

To avoid confusion and support better compatibility with retina (deviceRatio=2 for mac) and non-retina display, when we try
session.set_view_area(800, 800), for example, we should keep the size of the output PNG as 800x800. Currently, if a Retina display is detected, we will see the resulting PNG has a size of 1600x1600.

example script

from carta.session import Session
from carta.browser import Chrome

url_without_token = 'http://localhost:3003'
image_file_0 = 'HD163296_CO_2_1_subimage.fits'

session = Session.create(Chrome(), url_without_token, debug_no_auth=True)
session.set_view_area(800, 800)
img0 = session.open_image(image_file_0)
img0.set_channel(88)
img0.set_colormap('tab10')
session.save_rendered_view('create_session.png')
@kswang1029 kswang1029 added this to CARTA Dec 6, 2023
@kswang1029 kswang1029 moved this to Icebox in CARTA Dec 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
Status: Icebox
Development

No branches or pull requests

1 participant