Say I have a jpeg file and I want to set some pixels to a certain color. When I save the jpeg, I am losing color and I see aliasing around my new pixels, even if I set quality to 100. I know it s a lossy format, but I don t want to re-compress the picture, just set a few pixels.
// Create the GD resource
$img = imagecreatefromjpeg($filename);
// Set the first pixel to red
$color = imagecolorallocate($img, 255, 0, 0);
imagesetpixel($img, 0, 0, $color);
// Save the jpeg - is this where I m wrong? I see the red pixel but it s the wrong color and is blurred.
imagejpeg($img, foo.jpg , 100);
// Lossless format works fine, red pixel is bright and accurate.
imagepng($img, foo.png );
因此,要走什么路? 我确实需要改变一些餐厅的颜色,在节省时,需要准确。 如果不依靠全球投资框架、国家投资计划或联合项目2000,是否有办法做到这一点?