473,396 Members | 2,033 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

ImageCreateFromPNG

I'm writing a php script with the gd library. I had everything working
wonderfully, however, all of the sudden, If i import two png's into one
image, the quality of the second png degrades very badly.

If I only use one, it looks fine. If i load one with
ImageCreateFromPNG and reference it twice, it looks fine. It's only
when I use ImageCreateFromPNG twice on two different files, the second
one looks awful. Any suggestions?

Jul 17 '05 #1
2 3428
rich wrote:
I'm writing a php script with the gd library. I had everything working
wonderfully, however, all of the sudden, If i import two png's into one
image, the quality of the second png degrades very badly.

If I only use one, it looks fine. If i load one with
ImageCreateFromPNG and reference it twice, it looks fine. It's only
when I use ImageCreateFromPNG twice on two different files, the second
one looks awful. Any suggestions?


You're trying to combine images with different colour tables.

Use imagecreatetruecolor() to make a 24-bit full-colour image, and paste
your PNGs into that.

--
phil [dot] ronan @ virgin [dot] net
http://vzone.virgin.net/phil.ronan/
Jul 17 '05 #2
Excellent! That was it. Thank you much.

Jul 17 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Cecile Muller | last post by:
I've been trying to just open a png and display it, that way: <? header ("Content-type: image/png"); $im = imagecreatefrompng('empty.png'); imagepng($im); ?> But the transparency is not...
4
by: Gregory | last post by:
Hello, I've managed to build two web pages, one that can display images with associated text data in a table, and one that can resize and display images without the text. I'd like to resize the...
14
by: Gregory | last post by:
Hello, I'm trying to do the above in order to process an image and return the result to an html image control. It fails and my key suspects are either the variable that I'm passing in -...
8
by: Krzysztof Kujawski | last post by:
I'm trying to get an image to analize by imagecreatefrompng(http://www.domain.pl/png.php); The file png.php is generating a PNG file different for all logged users in domain (cookies are used in...
6
by: dan glenn | last post by:
PHP4.3.2, GD2 - I have found to my great dismay and consternation that if I load a jpg image , then save it as a PNG, the resulting PNG will actually work in a browser, but it can't be loaded again...
6
by: Darkbyte [Work] | last post by:
Hi everybody!!! I have a script (foo.php) which uses GD to create an image and sends it to the browser: <?php $img = imagecreatefrompng("mypng.png"); /* other stuff */ ...
3
by: toffee | last post by:
Hi all, not sure if this is possible in PHP - every couple of weeks; i get a few png files; which i th open in an image editor; add a text box with comments in the top right corner; save the...
1
by: visiperl | last post by:
Hi All, I'm pretty much at my wits end with vista IIS7 and php. I'm trying to get the gd library function imagecreatefrompng() function operating properly and have been unsuccessful. I've...
6
by: DarkLink | last post by:
Hey, Is there a way using PHP to get certain statistics from a specific website and arrange them on an image? (Yes, it is typically a dynamic image generator.)
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.