Posts:
3,620
Registered:
18-Oct-2002
|
|
|
Rewritten image tools
Posted:
13 Jan 25, 13:31
|
|
|
Optimising JPEG load and save speeds using libjpeg-turbo encouraged me to also rewrite the image tools we use in Edit mode. Several of them didn't have the ability to be hardware accelerated, either though the GPU or via the SIMD instructions found in modern CPUs. I "only" get a 1.43x speed improvement on my test project, but the code is now shorter, has the potential for hardware acceleration and is more flexible with regards to how the pixels are laid out in memory, avoiding conversion steps, so I'm optimistic about this rewrite.
But, as with any rewrite, comes the potential for bugs. I've done successful testing, but also appreciate that you test on your machines. After all, some of these operations are hardware specific. To test, ensure you run jAlbum 36.1.4 (do a core update), then replace ext/JalbumFilters.jaext with this one: https://jalbum.net/download/JalbumFilters.jaext
Optimised image tools are: Flip, Levels (Brightness and contrast), Gamma and Sharpen
What results do you get?
|
|
|
Posts:
8,435
Registered:
31-Jan-2006
|
|
|
Re: Rewritten image tools
Posted:
13 Jan 25, 14:20
in response to: davidekholm
|
|
|
Doing auto-correct on 150 images, I get a 15% reduction in build time. Not huge, but better than nothing.
And the tools are in ext, not lib.
|
|
|
Posts:
3,620
Registered:
18-Oct-2002
|
|
|
Re: Rewritten image tools
Posted:
13 Jan 25, 14:35
in response to: JeffTucker
|
|
|
Thanks for correcting the location and for testing. Yes, I expected more as well. I probably got a larger improvement as I was applying multiple filters on each image (to test them through)
|
|
|
Posts:
8,435
Registered:
31-Jan-2006
|
|
|
Re: Rewritten image tools
Posted:
13 Jan 25, 14:42
in response to: davidekholm
|
|
|
That's probably not a real-world condition. Tough to imagine a user applying auto-correction, gamma changes, flips, etc., to every image in a project. My suspicion is that if users apply the filters in batch mode, it's the auto-correct that they go for. Just a hunch....
|
|
|
Posts:
3,620
Registered:
18-Oct-2002
|
|
|
Re: Rewritten image tools
Posted:
13 Jan 25, 17:10
in response to: JeffTucker
|
|
|
That's probably not a real-world condition. Tough to imagine a user applying auto-correction, gamma changes, flips, etc., to every image in a project. My suspicion is that if users apply the filters in batch mode, it's the auto-correct that they go for. Just a hunch....
Yes I agree. Tackling autocorrect is harder but should be done as well.
|
|
|
Posts:
3,990
Registered:
4-Aug-2006
|
|
|
Re: Rewritten image tools
Posted:
13 Jan 25, 20:40
in response to: davidekholm
|
|
|
|
Sorry but it crashes on my M2 Mac. Did a core update to 36.1.5 and got the crash. Then added the new JalbumFilters.jaext file and got the crash again. Both times I was creating a new project to test with - selected empty project and selected use folder. After a short delay I get the crash.
No crash with existing projects
Crash report attached, too big to enter directly!
|
|
|
Posts:
8,435
Registered:
31-Jan-2006
|
|
|
Re: Rewritten image tools
Posted:
13 Jan 25, 21:07
in response to: RobM
|
|
|
No problem on my M2 Mac. Did the core update, shut it down, relaunched, shut it down, installed new filters, relaunched, created a project, and built an album.
|
|
|
Posts:
3,990
Registered:
4-Aug-2006
|
|
|
Re: Rewritten image tools
Posted:
13 Jan 25, 21:10
in response to: JeffTucker
|
|
|
No problem on my M2 Mac. Did the core update, shut it down, relaunched, shut it down, installed new filters, relaunched, created a project, and built an album.
I'll try removing all images and adding a few a time, just incase it is a duff file.
|
|
|
Posts:
3,990
Registered:
4-Aug-2006
|
|
|
Re: Rewritten image tools
Posted:
13 Jan 25, 22:03
in response to: RobM
|
|
|
It was a bunch of images from a backup source, images taken with different devices and nothing odd when looking at the metadata with exiftool, nothing odd in Finder. In jAlbum the error was caused by images that had blank entries when looking at the comments view.
Trying again with fewer images but all that load ok.
|
|
|
Posts:
3,990
Registered:
4-Aug-2006
|
|
|
Re: Rewritten image tools
Posted:
13 Jan 25, 22:18
in response to: RobM
|
|
|
jAlbum 36.1.5 old filter, settings>Auto correct all applied: "73 jpgs" made in 12.262s
Deleted album
jAlbum 36.1.5 new filter, settings>Auto correct all applied: "73 jpgs" made in 12.034s
Gain of 1.86%
jAlbum 36.1.5 old filter, Edit>Auto correct all applied: copy&Pasted to all "73 jpgs" made in 12.377s
Deleted album
jAlbum 36.1.5 new filter, Edit>Auto correct all applied: copy&Pasted to all "73 jpgs" made in 11.811s
Gain of 4.6%
|
|
|
Posts:
3,620
Registered:
18-Oct-2002
|
|
|
Re: Rewritten image tools
Posted:
14 Jan 25, 15:36
in response to: RobM
|
|
|
Rob, remember, auto-correct is still not optimized.
|
|
|
Posts:
3,620
Registered:
18-Oct-2002
|
|
|
Re: Rewritten image tools
Posted:
14 Jan 25, 15:37
in response to: RobM
|
|
|
@Rob, do a core update to v36.1.5 to have that crash bug resolved.
|
|
|
Posts:
3,990
Registered:
4-Aug-2006
|
|
|
Re: Rewritten image tools
Posted:
14 Jan 25, 16:48
in response to: davidekholm
|
|
|
@Rob, do a core update to v36.1.5 to have that crash bug resolved.
Already on 36.1.5 when I got the crash. Found out that some of the images where apparently not in good health, though not sure why as outside jAlbum they seemed ok.
Also noticed that the ‘bad’ images were added to the albumfiles without a date entry.
Will try other image tools tonight, now I have more time and a reasonable set of images.
|
|
|
Posts:
3,620
Registered:
18-Oct-2002
|
|
|
Re: Rewritten image tools
Posted:
14 Jan 25, 18:42
in response to: RobM
|
|
|
@Rob, please do a core update again. The latest v36.1.5 (there should really only be one) should not crash like you reported. If it does, please pass me an updated crash log.
|
|
|
Posts:
3,990
Registered:
4-Aug-2006
|
|
|
Re: Rewritten image tools
Posted:
14 Jan 25, 20:16
in response to: davidekholm
|
|
|
@Rob, please do a core update again. The latest v36.1.5 (there should really only be one) should not crash like you reported. If it does, please pass me an updated crash log.
OK, updated again and it has fixed the error - still shows 36.1.5.
Test results using 95 jpg images, after each effect added and album made, the album was deleted.
Old filter Horizontal flip = 15.679s, Greyscale = 24.636s, Rotate by 3 degrees = 25.186s
New filter Horizontal flip = 14.554s, Greyscale = 23.248s, Rotate by 3 degrees = 24.49s
|
|
|
|
Legend
|
|
Forum admins
|
|
Helpful Answer
|
|
Correct Answer
|
|