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

Blurring: using -progressive is much slower than baseline #45

Open
Stefal opened this issue Apr 9, 2024 · 1 comment
Open

Blurring: using -progressive is much slower than baseline #45

Stefal opened this issue Apr 9, 2024 · 1 comment

Comments

@Stefal
Copy link
Contributor

Stefal commented Apr 9, 2024

I noticed that displaying blurred images was much slower than unblurred images. I've noticed the same slower behaviour when loading these blurred images in Josm or The Gimp.

After some investigations, the culprit seems to be the -progressive argument used with all jpegtran command, ie:

p = subprocess.run('jpegtran -progressive -optimize -copy all -trim -drop +%s+%s %s %s > %s' % (crop_rects[c][0], crop_rects[c][1], tmpcrop+'_tmp', tmp, tmp+'_tmp'), shell=True)

When I remove this argument, I get back the original speed, and the blurring process on large images is much faster.

Blurring 20 high res images (80MP) with -progressive : 687 seconds
Blurring 20 high res images (80MP) without -progressive : 260 seconds

This 2.6 factor depends on the image size and how many areas need to be blurred.

As Panoramax/geovisio viewer use only baseline images, and has to convert back blurred images from progressive to baseline, I propose to remove -progressive

It looks like there is one drawback : baseline images are a little bigger, about 4% on my 20 jpg set.

Stefal added a commit to Stefal/sgblur that referenced this issue Apr 9, 2024
Keep images in baseline mode with `-progressive` argument removal on all jpegtran commands.

See cquest#45
@Stefal
Copy link
Contributor Author

Stefal commented Apr 9, 2024

Some discussions on baseline/progressive jpeg:
yeoman/yeoman#810 (comment)
yeoman/yeoman#810 (comment)

More space needed with baseline jpg:
https://www.bookofspeed.com/chapter5.html

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