Php: resize gif and png images with a transparent background turned black. Resize png
In the work, you need to scale some gif images and then go to Imagecopymerge. However, after using imagecreatetruecolor and imagecopyresampled, you find that the
FF and IE7 have directly supported the transparent PNG map, and the next one is mainly to solve the IE6 transparent PNG picture with a gray bottom
Copy Code code as follows:
Style=
Note: This feature relies on the GD2 graphics library
recently to use PHP to generate thumbnails, find a bit online, found this article: PHP Generate thumbnail image
After a trial, we found that there were several problems:
1. PNG images generated
Note: This feature relies on the GD2 graphics libraryrecently to use PHP to generate thumbnails, find a bit online, found this article: PHP Generate thumbnail imageAfter a trial, we found that there were several problems:1. PNG images generated
PNG (Portable Network Graphics) is a common format recommended by W3C for web images. However, the alpha channel of PNG is not opened for IE6 or earlier (which is supported by IE7, the effect of the transparent PNG image is reduced. Normally
Background Images | Transparent PNG images play a very important role in web design, using the features of PNG images to produce practical, gorgeous results, but the support for PNG images is not ideal, Firefox and opera support PNG better,
Periodically, someone tells me about the magic of PNG, how it's the ideal image format for the web, and that someday we'll all be using it on our sites instead of GIF. people have been saying this for years, and by now most of us have stopped
IE6 PNG Transparent (three solutions) (Turn to OH)FF and IE7 have direct support for transparent PNG maps, the following is mainly to solve the IE6 under the transparent PNG image has a gray bottom=====================================================
/*
* Desc:resize Image (PNG, JPG, GIF)
*/
Class Resizeimage {
Type of picture
Private $type;
Actual width
Private $width;
Actual height
Private $height;
The width after the change
Private
The IE family has only 9 versions to support this attribute;
Having children's shoes may not be very clear to the RGBA environment, but must be familiar with the opacity attribute. Opacity implements the alpha channel of the element, such as
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.