Announcement

#1 2018-04-13 09:53:42

tomass
Member
New Zealand
2015-06-16
21

Issue with resized images sharpening

Hello,
I would like to set sharpening for resized smaller versions of photos in my gallery. I found that this can be set in admin panel -> configuration - options - photo sizes, show details, edit sharpening percentage per size. However if I set a non-zero value for sharpening parameter, I am unable to get images re-generated. Looking around I found following in my Apache error log:

[Fri Apr 13 19:20:40.259976 2018] [:error] [pid 8297] [client 192.168.XXX.XXX:38952] PHP Fatal error:  Uncaught exception 'ImagickException' with message 'The kernel must contain a square number of elements' in /var/www/html/photos/admin/include/image.class.php:468\nStack trace:\n#0 /var/www/html/photos/admin/include/image.class.php(468): Imagick->convolveimage(Array)\n#1 [internal function]: image_imagick->sharpen(16)\n#2 /var/www/html/photos/admin/include/image.class.php(93): call_user_func_array(Array, Array)\n#3 /var/www/html/photos/i.php(557): pwg_image->__call('sharpen', Array)\n#4 /var/www/html/photos/i.php(557): pwg_image->sharpen(16)\n#5 {main}\n  thrown in /var/www/html/photos/admin/include/image.class.php on line 468, referer: https://tomassobekphotography.co.nz/pho … category/7

It seems the same as discussed in http://piwigo.org/forum/viewtopic.php?id=22135 - There the suggested solution was not to use sharpening.

* Is sharpening possible at all?
* Or is my ImageMagick too old for sharpening to work?
* Or do I need to uninstall ImageMagick so that GD is used - if so, are there any downsides?

Cheers, Tomas

Piwigo 2.9.1
Operating system: Linux
PHP: 5.5.9-1ubuntu4.21
MySQL: 5.7.17
Graphics Library: ImageMagick 6.7.7-10
Piwigo URL: https://tomassobekphotography.co.nz/photos/

Offline

 

#2 2018-04-14 03:51:15

tomass
Member
New Zealand
2015-06-16
21

Re: Issue with resized images sharpening

I tested what happens when I disable ImageMagick:

Code:

php5dismod imagick

Now my Piwigo is reports Graphics Library: GD 2.1.1-dev

I can set various amounts of sharpening between 0 a 100 and regenerate smaller sizes, that's a good start. I can see that the resulting images have slightly different file sizes however the differences are very very subtle and only noticeable in small sizes. See an example of Medium size image and difference between sharpening 0 and 100 percent. For reference, here is the photo in my gallery: https://tomassobekphotography.co.nz/pho … category/7

I was wondering if this is intentional? IMO it would be useful to be able to set a bit more aggressive sharpening, especially for smaller versions.

For comparison I tried to scale the same image down to the same size in Gimp and apply unsharp mask (radius 5, amount 0.25, threshold 0). This is roughly what I would like to be able to achieve in Piwigo. See results attached.

Offline

 

#3 2018-04-28 06:17:43

tomass
Member
New Zealand
2015-06-16
21

Re: Issue with resized images sharpening

I left accidentally one of the sharpening parameters on 100%. Another day I realized that that size looked very over-sharpened. So it seems there is some propagation lag between setting this parameter and when it takes effect. This is not great for testing when finding out the best sharpening percentage value. I guess bouncing the web server after setting new values could work around this problem.

I also checked if there is already an event defined to fire when a new downsized image is being created. I thought it could be a sensible idea to off-load this functionality to a plugin. I checked the list of Piwigo events here - http://es.piwigo.org/demo/tools/triggers_list.php - but haven't noticed any with a likely name.

I was wondering, if any of the core developers reads this, if they think such an event should be added? Or if the core functionality should simply be fixed for Image Magick library? IMO pulling the functionality into a plugin would provide better flexibility. Personally I haven't written much code in my life but I would feel comfortable experimenting with developing a plugin.

Offline

 

#4 2018-04-28 14:03:48

flop25
Piwigo Team
2006-07-06
7037

Re: Issue with resized images sharpening

the downsized images generation is meant to be the lighter possible so it's a file containing juste what it needs and nothing else such as triggers


To get a better help : Politeness like Hello-A link-Your past actions precisely described
Check my extensions : more than 30 available
who I am and what I do : http://fr.gravatar.com/flop25
My gallery : an illustration of how to integrate Piwigo in your website

Offline

 

Board footer

Powered by FluxBB

github twitter newsletter Donate Piwigo.org © 2002-2024 · Contact