PHP Developers Network

A community of PHP developers offering assistance, advice, discussion, and friendship.
 
Loading
It is currently Fri Sep 21, 2018 5:54 am

All times are UTC - 5 hours




Post new topic Reply to topic  [ 547 posts ]  Go to page Previous  1 ... 33, 34, 35, 36, 37
Author Message
PostPosted: Fri Mar 24, 2017 7:02 am 
Offline
Moderator
User avatar

Joined: Tue Nov 09, 2010 3:39 pm
Posts: 6424
Location: Montreal, Canada
You could pass an empty array to options, or you could specify compression level 9 (which is the highest). How specifically you implement that is up to you and would depend somewhat on your use case. You say "when an image is 2560". When it's exactly that wide? When it's that wide or larger? When you're processing an image for a screen width of 2560?

_________________
Supported PHP versions No longer supported versions


Top
 Profile  
 
PostPosted: Fri Mar 24, 2017 10:20 am 
Offline
DevNet Master

Joined: Wed Oct 08, 2008 3:39 pm
Posts: 4422
Location: United Kingdom
The problem we are facing, is when certain banners are uploading, with let's say an orange block and some text it in, it gets compressed a bit (we altered it to 95), and the quality is reduced not brilliantly.
But we tried the same banner in Wordpress and it didn't lose that quality.

I thought the 4K versions weren't compressed but they obviously are. On the 1920 versions people are seeing the reduction in quality. I don't know why. Slight blurring on text for example.

_________________
Love PHP. Love CSS. Love learning new tricks too.
All the best from the United Kingdom.


Top
 Profile  
 
PostPosted: Fri Mar 24, 2017 10:28 am 
Offline
Moderator
User avatar

Joined: Tue Nov 09, 2010 3:39 pm
Posts: 6424
Location: Montreal, Canada
Well to begin with you probably don't want to be using JPG + text, but that's maybe a separate issue. What are you starting with, what are you resizing to, and what are you ending up with?

_________________
Supported PHP versions No longer supported versions


Top
 Profile  
 
PostPosted: Fri Mar 24, 2017 10:28 am 
Offline
Moderator
User avatar

Joined: Tue Nov 09, 2010 3:39 pm
Posts: 6424
Location: Montreal, Canada
simonmlewis wrote:
But we tried the same banner in Wordpress and it didn't lose that quality.

Have you looked at how they do it?

_________________
Supported PHP versions No longer supported versions


Top
 Profile  
 
PostPosted: Mon Mar 27, 2017 4:24 am 
Offline
DevNet Master

Joined: Wed Oct 08, 2008 3:39 pm
Posts: 4422
Location: United Kingdom
I wouldn't know where to start to look.
Clearly their code is slightly different. I just did another, as we added that code to another page - quality isn't so sharp. Even at 95%!

_________________
Love PHP. Love CSS. Love learning new tricks too.
All the best from the United Kingdom.


Top
 Profile  
 
PostPosted: Mon Mar 27, 2017 4:57 am 
Offline
Moderator
User avatar

Joined: Tue Nov 09, 2010 3:39 pm
Posts: 6424
Location: Montreal, Canada
You're resizing from the same original image to the same sizes? Quality of all the test images I did was fine, but none had text. Any way you can be more specific? Anything you can show us for the sake of comparison?

_________________
Supported PHP versions No longer supported versions


Top
 Profile  
 
PostPosted: Tue Feb 13, 2018 9:27 am 
Offline
DevNet Master

Joined: Wed Oct 08, 2008 3:39 pm
Posts: 4422
Location: United Kingdom
Hi. I am usinig this function code now for a slightly different purpose, and need to pass thru to the directory structure, a variable, to dynamically change what folder the image is being saved into.

It's part of a different thread, but as this thread is the core code I am using, wanted to add it here.

_________________
Love PHP. Love CSS. Love learning new tricks too.
All the best from the United Kingdom.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 547 posts ]  Go to page Previous  1 ... 33, 34, 35, 36, 37

All times are UTC - 5 hours


Who is online

Users browsing this forum: Google [Bot], Majestic-12 [Bot] and 16 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
Powered by phpBB® Forum Software © phpBB Group