Bug #75072 [Opn->Nab]: imagepng does not produce lossless output when input is lossy
| From: | cmb@php.net | Date: | Sun, 13 Aug 2017 22:00:35 +0000 |
| Subject: | Bug #75072 [Opn->Nab]: imagepng does not produce lossless output when input is lossy | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-210663@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=75072&edit=1
ID: 75072
Updated by: cmb@php.net
Reported by: choinnn1 at gmail dot com
Summary: imagepng does not produce lossless output when input
is lossy
-Status: Open
+Status: Not a bug
Type: Bug
Package: GD related
Operating System: Windows 8.1
PHP Version: 7.1.8
-Assigned To:
+Assigned To: cmb
Block user comment: N
Private report: N
New Comment:
> php-logo_php.png should be visually 100% identical to both
> php-logo.jpeg and php-logo_paint.png.
This assumption is not in agreement with the JPEG standard, which
does not require all decoders to produce identical output images.
See also <https://stackoverflow.com/questions/23565889/jpeg-images-have-different-pixel-values-across-multiple-devices#23714501>.
Previous Comments:
------------------------------------------------------------------------
[2017-08-13 19:01:08] choinnn1 at gmail dot com
Description:
------------
1. Save image: http://www.softaculous.com/blog/wp-content/uploads/2013/04/php-logo.jpeg
as php-logo.jpeg
2. Open php-logo.jpeg in Windows Paint, save as php-logo_paint.png
3. Write a script in PHP to convert php-logo.jpeg into php-logo_php.png
Test script:
---------------
imagepng(imagecreatefromjpeg('C:\php-logo.jpg'), 'C:\php-logo_php.png');
Expected result:
----------------
php-logo_php.png should be visually 100% identical to both php-logo.jpeg and php-logo_paint.png.
Actual result:
--------------
php-logo_php.png contains slightly different colors when compared to php-logo.jpeg and
php-logo_paint.png.
See the diff (made with Beyond Compare):
php-logo.jpeg vs php-logo_php.png: http://i.imgur.com/0nY42bF.png
php-logo.jpeg vs php-logo_paint.png: http://i.imgur.com/sjgyHAE.png
Note: php-logo_paint.png is 32-bit PNG image by default for me, but it's not relevant. If I
convert it to 24-bit PNG or use Paint.NET instead of Microsoft Paint from the start, the result will
be the same.
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=75072&edit=1