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

Changed default sharpening value. #436

Closed
wants to merge 1 commit into from
Closed

Changed default sharpening value. #436

wants to merge 1 commit into from

Conversation

LostKobrakai
Copy link

Sharpening "soft" caused quite blured images even on 1:1 crop after my update from 2.3. With the old config.php in place, one doesn't have the sharpening option visible. I think not breaking the image-croping on update is quite important, while new installations use "soft"-sharpening, because it's in the config.php.

Sharpening "soft" caused quite blured images even on 1:1 crop after my update from 2.3. With the old config.php in place, one doesn't have the sharpening option visible. I think not breaking the image-croping on update is quite important, while new installations use "soft"-sharpening, because it's in the config.php.
@horst-n
Copy link
Contributor

horst-n commented Apr 7, 2014

@LostKobrakai: My personal opinion is, that if you upgrade the wire folder, you have to compare your older config.php against the new one and update it manually where necessary.

The other thing is that I cannnot follow what you are saying. ?
The images are blurred because they get sharpenend now with the new version?

Second point is: regardless if you have that option set in your config.php or not, the default behave is a 'soft' sharpening. And this results in lesser blurred images per default, what is an enhancement for nearly all, but at least most common images. If it would be set to 'none' the most sites / users would not have benefit from the new functionality because they all would have to setup this manually. And at first they have to know about it, - I think this is impractical.

If you like, you may send me (or link to) one or two example images with the quite blurred behave. I would like to see what's happen and if we can do something better.

@LostKobrakai
Copy link
Author

I know, that it should sharpen the images, but for me it caused blured thumbnails. Not just a little bit, but really blured and little bit of darkened areas. I tried different pictures, while they all suffered the same. Turning the sharpening off resolved the issue.

From my point of view image sharpening isn't that useful, if you don't scale down images by a quite large amount. I want my images displayed in the way I upload them, and if I then see, that it needs some sharpening, I'll activate it. My experience with sharpening, if it works correctly, is that it's just to likely to cause artefacts in the images.

Accounting your second point. Every new installation still gets the sharpening because it's listed in the default config.php. Than people can decide to use it or not. As you said, people who upgrade processwire have to edit their config.php, no matter what the dafault behavior is. So in my opinion this change just helps to not break the image-resizing on upgrades.

@horst-n
Copy link
Contributor

horst-n commented Apr 7, 2014

I agree with that images only should be sharpened if they get scaled down. If images get processed without downscaling, I would declare it a bug!

In general sharpening is useful, but sharpening with GD-lib may be not the best solution. Lately we have started to build a module for resizing with ImageMagick (via PHP-extension Imagick). With it we get much better results in some points that are buggy with the GD-lib. But also with the GD-lib we get good results in many cases.

So I'm interested in all images that causes problems at some points. To view / analyze this helps to take more cases into account, not only the personal way to work with images.

Can you send / link to an image that get blured with sharpening = soft and an imagevariation without the sharpening? It really would help to understand better what was happened.

@LostKobrakai
Copy link
Author

original
thumbnail_none
thumbnail_soft
thumbnail_medium
thumbnail_strong

That's what happend to my images. First the original, than the thumbs from sharpening none to strong. To generate the thumbs I use the Thumbnails Module. I don't know if it uses other image processing, than the standart method.

gd_version

@horst-n
Copy link
Contributor

horst-n commented Apr 8, 2014

@LostKobrakai: Thank you very much for helping out with example images.
This looks really weird. It is unbelievable, I never have seen this before.
('strong' looks like effect-filter edgedetect or something)

Unfortunately I cannot reproduce this.
Here is a testcase with your original image as source: http://images.pw.nogajski.de/image-sizer-core/sharpening/sharpen/

You said you use Thumbnails Module. What version do you have installed and what is your code in the templatefile to call this?

BTW: In my testcase site, the variation with soft sharpening looks like the best output for me :)

@LostKobrakai
Copy link
Author

It's the newest version. 1.0.3 for the main-module 1.0.2 and 1.0.1 for the additional ones.

I use small,400,300 as image size in the fieldtype settings and I call it with …images->getThumb("small"); which gets me the url.

@horst-n
Copy link
Contributor

horst-n commented Apr 8, 2014

Ok, have installed latest Thumbnails Module like you have, have created 4 copies of the sourcefile and created one Thumbnail each with a different sharpening mode according to the images filename.
Look here: http://images.pw.nogajski.de/image-sizer-core/sharpening/sharpen/

It all works as expected. The soft one is the best one! :)

It seems that this is something very special to your machine. Is this a local server or a online server? Can you try it on another machine?

@LostKobrakai
Copy link
Author

It's a fresh install of MAMP Pro 3.

@horst-n
Copy link
Contributor

horst-n commented Apr 8, 2014

It seems there is something broken with your PHP GD-lib. I would try to fix that with a fresh download and new install. Or if you have a second machine use this with a different install. But do not use the same downloaded mamp version. Take a fresh one. Or use an older one just to compare.
Or if you are a bit familiar with that stuff, you just can download the appropriate PHP Version and copy that files over your existing one from MAMP. But be careful to get the correct one!

@k07n
Copy link

k07n commented Apr 8, 2014

Hi! On my local server (OpenServer 5) I have ugly sharpening too, but on live one (ubuntu) everything is OK. So, I think gd-lib on windows sucks in this case.

@LostKobrakai
Copy link
Author

MAMP is mac software. So it's not windows specific.

@k07n
Copy link

k07n commented Apr 8, 2014

ok, it is gd-lib specific

@k07n
Copy link

k07n commented Apr 8, 2014

I have switched to php5.4 from 5.5 on local machine and sharpening works perfect, so it is php specific =)

@LostKobrakai
Copy link
Author

I'm currently working with php 5.5.10 so I wouldn't specify it that generally.
-- 
www.kobrakai.de | Bauernstraße 5B | 86508 Rehling | 015221616149

Am 8. April 2014 bei 23:06:49, k07n (notifications@github.com) schrieb:

I have switched to php5.4 from 5.5 on local machine and sharpening works perfect, so it is php specific =)


Reply to this email directly or view it on GitHub.

@werker
Copy link

werker commented Apr 8, 2014

This describes a bug for the php-gd function imageconvolution:
https://bugs.php.net/bug.php?id=66714

As this function seems to be buggy under php version 5.5.9 and 5.5.10 it could be the source of your problem. Could you try php 5.5.11?

@horst-n
Copy link
Contributor

horst-n commented Apr 9, 2014

@werker: thanks for pointing us to that!

@horst-n
Copy link
Contributor

horst-n commented Apr 9, 2014

Please, this can be closed.

Have send a pull request: #440

@netdoctor
Copy link

@horst-n Since versions of 5.5 below 5.5.11 have security issues I would say not. They would be better off being warned to upgrade php. :)

@horst-n
Copy link
Contributor

horst-n commented Apr 13, 2014

@netdoctor
every PHP version has security issues, known and unknown ones. :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants