Last modified: 2010-05-15 16:02:53 UTC
When a monochrome or web optimized bitmap image (like .PNG) is thumbnailed using ImageMagick or GD the size is larger than the original. The size is even about 6 times larger than it could/should be. Usually the disksize is not a problem, but the bandwidth for dail up connections is. And my monthly site bandwidth is limited. Thumbnails should be smaller than the original. The thumbnails are created by GD using the function imagecreatetruecolor(...) to create a blank new image in which the thumbnail is created. So the destination image is a true color image which is therefor larger than the source. When imagecreate(...) is used for the non true color images these thumbnails are much smaller. The following code in media/Bitmap.php at about line 170 does this. if (imageistruecolor( $src_image ) ) { $dst_image = imagecreatetruecolor( $physicalWidth, $physicalHeight ); } else { $dst_image = imagecreate( $physicalWidth, $physicalHeight ); } ImageMagick using the -depth 8 option also creates a full color image from the source. I have not found a solution for this yet.
*** This bug has been marked as a duplicate of bug 1218 ***
It is not completely a duplicate of bug 1218, since that bug is all about ImageMagick and I suggest a fix for the same problem when GD is used and not ImageMagick. I should not have mentioned ImageMagick.
Bug 1218 covers GD too. Discussion might be focused on ImageMagick because that's what Wikipedia uses, but that doesn't restrict the bug's focus. It's more or less the same underlying issue, it seems: you have to figure out how to deal with the increase in color depth due to interpolation.