Usamos cookies para medir audiência e melhorar sua experiência. Você pode aceitar ou recusar a qualquer momento. Veja sobre o iMasters.
Bom galera é o seguinte, quero transformar uma imagem 1024x768 para 1280x800, para isso usei imagecopyresized:
<?php
// File and new size
$filename = 'teste.jpg';
// Content type
header('Content-type: image/jpeg');
// Get new sizes
list($width, $height) = getimagesize($filename);
$newwidth = 1280;
$newheight = 800;
// Load
$thumb = imagecreatetruecolor($newwidth, $newheight);
$source = imagecreatefromjpeg($filename);
// Resize
imagecopyresized($thumb, $source, 0, 0, 0, 64, $newwidth, $newheight, 1024, 640);
// Output
imagejpeg($thumb);
?>
Como podem ver, a imagem de 1024x768 é cortada (embaixo e em cima) para 1024x640 para depois ser aumentada para 1280x800.
Dai o que acontece?
A imagem perde muita resolução, vejam só:
1024x768 (original)
http://img521.imageshack.us/img521/9751/lamborghinigallardo5wal.jpg
1200x880
http://img26.imageshack.us/img26/9751/lamborghinigallardo5wal.jpg
Existe alguma solução pra ficar menos distorcida?
Carregando comentários...