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

For your reference #9

Closed
k-fung opened this issue Aug 16, 2012 · 5 comments
Closed

For your reference #9

k-fung opened this issue Aug 16, 2012 · 5 comments

Comments

@k-fung
Copy link

k-fung commented Aug 16, 2012

Dear David,
I found an app works with the large image very well.
The image decode process is very fast.
http://itunes.apple.com/us/app/secret-photo+folder/id367327563?mt=8

Please feel free to have a look.
Do you know how could they do?

@k-fung
Copy link
Author

k-fung commented Aug 16, 2012

I am sorry that I have too many ideas.
Is it possible to generate the tiles on demand?

First, just make the tiles of the full image. When the user enlarge the image to (1) then make the tile 1 and then tile 2,4,5

1 2 3
4 5 6
7 8 9

if the user move to tile 2 then make tile 3,6

The user experience must be better, because you no need to wait a few seconds for making all tiles.

@dhoerl
Copy link
Owner

dhoerl commented Aug 18, 2012

On 8/16/12 12:26 PM, k-fung wrote:

Dear David,
I found an app work with the large image very well.
The image decode process is very fast.
http://itunes.apple.com/us/app/secret-photo+folder/id367327563?mt=8

Please feel free to have a look.
Do you know how could they do?

I did not buy the app, but many people posted methods to pre-tile images
so you could save them in your app bundle, and show very large images
immediately (as long as they were local).

Is that what this app does?

For apps that download images, then I'm pretty sure I'm pretty close to
optimum speed as the tiles are pre-rendered as the data comes in. For
large jpegs on disk, though, it would be faster to open the image, make
a small jpeg and show it normally (no tiles), then tile the big image,
then replace the small jpeg with the small tiled image and then let the
user zoom.

So to conclude - the strategy for images locally can definitely be
improved - my original goal was only to deal with large downloaded images.

David

@dhoerl
Copy link
Owner

dhoerl commented Aug 18, 2012

On 8/16/12 12:47 PM, k-fung wrote:

I am sorry that I have too many ideas.
Is it possible to generate the tiles on demand?

First, just make the tiles of the full image. When the user enlarge the
image to (1) then make the tile 1 and then tile 2,4,5

1 2 3
4 5 6
7 8 9

if the user move to tile 2 then make tile 3,6

The user experience must be better, because you no need to wait a few
seconds for making all tiles.

If you examine the code, it tries to keep its memory footprint low. So
to get the lowest resolution image - the original one shown to the user

  • it keeps all resolutions open, writing smaller and smaller number of
    pixels as the image size gets smaller. The only way to get the smallest
    image first is would be to do two passes - open huge image, scan every
    line, then make the smallest image. After that was done, open image
    again, re-scan every line, then make the other images.

If the images are on the disk locally, then for sure there could be a
cache of the smallest resolution. User opens that image, the smaller
tiled image is available, read that in and show it, then in the
background start to process the big image. If user scrolls to next
image, cancel that and start on the next image, etc.

@k-fung
Copy link
Author

k-fung commented Aug 18, 2012

"If user scrolls to next image, cancel that and start on the next image"

I can clean all the tiled images, but I failed to cancel the build.
Would you please tell me how to cancel when TiledImageBuilder is in process?

How is your progress in dealing with the local images?

@dhoerl
Copy link
Owner

dhoerl commented Feb 12, 2020

Cancel added to the Swift Package.

@dhoerl dhoerl closed this as completed Feb 12, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants