thumbnail operation performance #4755
Replies: 4 comments 2 replies
-
In your table, what are the numbers "0,288" etc? Perhaps these are the times in seconds for the operation, using the European "decimal comma". I suppose your outputs between 800 and 1100 are from resize.c function ThumbnailImage() doing two operations: SampleImage() and then ResizeImage(). The timings will depend on whether your computer uses the GPU, and other factors. |
Beta Was this translation helpful? Give feedback.
-
I don't know why ThumbnailImage() scales up and then resizes down. But the stated goal is to make "small low cost thumbnail images" rather than fast performance. |
Beta Was this translation helpful? Give feedback.
-
On my (Windows) computer, timings of one or two seconds are too variable to be a useful guide. I use "-duplicate 9" or similar after reading an image, before doing an operation, for a more reliable performance number. On my computer, "-sample" is much faster than "-resize", which is slightly faster than "thumbnail", which is slightly faster than "-scale". This is a bit strange as "-scale" is a simpler operation than "-resize". Why is it slower? I suspect this is because "-resize" uses the GPU but "-scale" doesn't.
I don't understand that. Why copy the logic? Why not just call the function? If they want some variation of the function, they can do that, of course. If the resulting code is in some sense an improved version of thumbnail, they might contribute it to the IM project. |
Beta Was this translation helpful? Give feedback.
-
Rerun your time tests against the main repo or ImageMagick-7.1.0-26 or ImageMagick-doc-6.9.12-40 Beta. Is there an improvement in performance? What about the effect on image quality? |
Beta Was this translation helpful? Give feedback.
-
I have a question about the
-thumbnail
operation performance. I did some tests and the conclusion is, that the performance of the thumbnail operation depends on the ratio between the original and target size. While I already knew that-thumbnail
does downsample the original image, what explains its fast performance when the original to target ratio is more than 5:1, I'm observing odd performance for ratios between 3:1 and 5:1.I did a simple test (using Linux time utility) making thumbnails of an image of size 3712x3712. It was thumbnalized to images from 100x100 to 2100x2100. The odd results are for thumbnails 800x800 to 1100x1100. It's faster to create a 1200x1200 than a 800x800 one. I also compared the performance to
-scale
with the same dimensions, and for 800x800 to 1100x1100-scale
is twice as fast.The question is: what is happening here? What is
-thumbnail
taking so much time to create an image at these resolutions?Beta Was this translation helpful? Give feedback.
All reactions