| Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read | ![]() |
|
||||||
![]() |
|
|
LinkBack | Thread Tools | Display Modes |
|
|||
|
In PHP for manipulating image files which is better function imagecopyresized() or imagecopyresampled(),
I know function imagecopyresampled() will resize the image but will also resample the image. What is this resampling of image, will it affect the quality of image if i use higher function values. ![]() |
|
||||
|
Dear One,
First up all you have not mention the specifications (It's a good practice) of the image, the most important thing to analyze the issue. If you haven't read this thread, http://www.webhosting.uk.com/forums/...read.php?t=672 I would recommend to read it first. Providing details information would be very useful to get help promptly. Lets come back to your question... Quote:
<!--[endif]--> There are several probabilities depending on the resolution of the image. If the resolution of the image is high enough, I mean the pixels then small size would not be a major concern. Second, you will have to maintain the proportion of the image. Large enough means how big? 3,4,5… times bigger? I guess not more than double. IMHO if you take care of these two then, you won't need to worry about the quality. ![]() |
|
||||
|
Sorry Harry I didn't realise you were resampling up.
If you're looking to make the image larger then the quality is going to pretty poor unless the size increase you're going for is very small. It all comes down to resolution - assuming your images are screen standard 72dpi then if you resize an image from 100px x 100px to 300px x 300px then you are lowering the dpi to a third which means each pixel is going to be three times larger resulting in a blocky image. Intelligent resampling will look to offset this by sticking to 72dpi and guessing at the colour of the extra pixels it creates, based on the colour of the surrounding pixels. This is better than just scaling up but Photoshop struggles with this sort of thing so I'm guessing a PHP function is going to have no chance. Unfortunately the only time I've ever used it is to scale down or to change the aspect ratio of an image so I can't give you a definitive answer. If you're only going up by a bit then I'd have a go. Let me know how you get on though because I'd be interested in the result.
__________________
homo sum: humani nil a me alienum puto ... ( just Google it ) |
|
||||
|
Quote:
|
|
||||
|
I'm guessing, but I think Harry probably wants to resize images on-the-fly - this is a useful function for a CMS for example - you can let users upoad images without them having to worry about resizing them. The you use PHP to resample/resize the image server-side.
__________________
homo sum: humani nil a me alienum puto ... ( just Google it ) |
![]() |
| Thread Tools | |
| Display Modes | |
|
|