10000 Fastest Method for Downscaling Large Image · Issue #136 · rkalla/imgscalr · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Fastest Method for Downscaling Large Image #136

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

Open
Ep0chalypse opened this issue Oct 1, 2021 · 0 comments
Open

Fastest Method for Downscaling Large Image #136

Ep0chalypse opened this issue Oct 1, 2021 · 0 comments

Comments

@Ep0chalypse
Copy link

Hi, I'm using imgscalr to downscale large images(4k+) and on certain large images the scaling takes ~8+ seconds. I have tried using METHOD.SPEED but it only took off ~100-200ms. If I scale the image using ImageMagick it takes around 2-2.5 seconds. I know there will be differences in image manipulation software, but is there any way to achieve similar results using imgscalr?

ImageMagick:
time convert -resize 150x 20210927_OHR.Susuki__JA-JP6548971154_UHD.jpg -quality 10 susuki.jpg
real 0m1.649s
user 0m2.312s
sys 0m0.244s

I'm using OpenJDK 16.0.2 on windows 10 x64 with these two images:
https://www.bing.com/th?id=OHR.Susuki__JA-JP6548971154_UHD.jpg
https://www.bing.com/th?id=OHR.TokyoSkyTree__JA-JP0701062199_UHD.jpg

Here is the relevant code(in kotlin):

fun generateThumbnailScalr(fullSizeImagePath: File) {
val startTime = System.currentTimeMillis()
val srcImage = ImageIO.read(fullSizeImagePath)
val scaledImage = Scalr.resize(srcImage, Scalr.Method.SPEED , 150)
val thumbFileExt = fullSizeImagePath.extension
val thumbImagePath = "Images/thumbs/scalr_${fullSizeImagePath.nameWithoutExtension}_thumb.$thumbFileExt"
val thumbFile = File(thumbImagePath)
ImageIO.write(scaledImage, "jpg", thumbFile)
println("[${System.currentTimeMillis() - startTime}ms] for $fullSizeImagePath")
}

Which outputs:
[8906ms] for Images\20210927_OHR.Susuki__JA-JP6548971154_UHD.jpg
[6694ms] for Images\20210929_OHR.TokyoSkyTree__JA-JP0701062199_UHD.jpg

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

1 participant
0