Image Resizing Script required - a better one...
Moderator: General Moderators
Re: Image Resizing Script required - a better one...
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?
-
simonmlewis
- DevNet Master
- Posts: 4435
- Joined: Wed Oct 08, 2008 3:39 pm
- Location: United Kingdom
- Contact:
Re: Image Resizing Script required - a better one...
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.
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.
All the best from the United Kingdom.
Re: Image Resizing Script required - a better one...
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?
Re: Image Resizing Script required - a better one...
Have you looked at how they do it?simonmlewis wrote:But we tried the same banner in Wordpress and it didn't lose that quality.
-
simonmlewis
- DevNet Master
- Posts: 4435
- Joined: Wed Oct 08, 2008 3:39 pm
- Location: United Kingdom
- Contact:
Re: Image Resizing Script required - a better one...
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%!
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.
All the best from the United Kingdom.
Re: Image Resizing Script required - a better one...
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?
-
simonmlewis
- DevNet Master
- Posts: 4435
- Joined: Wed Oct 08, 2008 3:39 pm
- Location: United Kingdom
- Contact:
Re: Image Resizing Script required - a better one...
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.
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.
All the best from the United Kingdom.