You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
At the moment images are downsampled to around display resolution on image load so for example if we have an image that is 3840 x 2160 (4k) getting loaded but our display / monitor is only 1080p, roseate will automatically downsample that image to 1920x1080 (plus some extra pixels).
This is great until we start zooming into the image and notice all the clarity we have lost, so let's dynamically adjust the downsampling when the user zooms in/out.
However this will need to be done in the background hence we will need #24 to be completed first.
The text was updated successfully, but these errors were encountered:
Every time the user zooms in, we upsample the image to a resolution equal to:
image_res x zoom_scale_factor
but the upsample resolution cannot exceed the original resolution of the image, essentially setting a cap.
The image should only upsample / downsample once the user is done zooming in / out (more info below) and we should only have one of these operations going on at a time but we should also cancel an ongoing operation or a scheduled one if we have to schedule a new upsample / downsample operation.
Also when zooming out the downsample should be scheduled a lot later than the upsample in the case the user would like to zoom in again for one quick glimpse. We only downsample in the first place to save on memory when detail is not important and also so high res images aren't overly sharpened.
It's all about user experience and efficiency.
reload image mechanism
Right now if we were to implement this we would be calling Image.load_image() many many times and Image.load_image() is not designed to be ran many many times as if that function is executed while the image is already loaded it will do a full complete image reload (re-reading bytes from the file and etc) when it's unnecessarily as the bytes would have already existed in memory via Image.image_bytes.
We need a new function like Image.reload_image() to handle cases as such below:
We want to downsample an already loaded image, the image bytes already exist so we should use them instead of reading from the file again.
We want to upsample an existing image that has already been downsampled, in this case we don't have the bytes in memory necessary to upsample so we'll have to read the entire file again and load that.
config
WIP is my brain, I'll think about it after implementation of some of this.
At the moment images are downsampled to around display resolution on image load so for example if we have an image that is
3840 x 2160
(4k) getting loaded but our display / monitor is only 1080p, roseate will automatically downsample that image to1920x1080
(plus some extra pixels).This is great until we start zooming into the image and notice all the clarity we have lost, so let's dynamically adjust the downsampling when the user zooms in/out.
However this will need to be done in the background hence we will need #24 to be completed first.
The text was updated successfully, but these errors were encountered: