/    Sign up×
Community /Pin to ProfileBookmark

why image is so large after creating…

i do not understand why the image that is created by php is so large. The original pic is only like 5.00kb++ but after the php create the image…it is like 52KB…this is the script that i use..

<?php
$ip = $_SERVER[‘REMOTE_ADDR’];
$image = “myimagepath”;
$im = imagecreatefromjpeg($image);
$tc = ImageColorAllocate ($im, 0, 0, 255);
$red = ImageColorAllocate ($im, 255, 0, 0);
$black = ImageColorAllocate ($im, 0, 0, 0);
ImageString($im, 2, 5, 5, “INTEL P4 2.4(?”, $tc);
header(“Content-Type: image/png”);
imagepng($im,”,75);
ImageDestroy ($im);
?>

and it is eating up alot of my BW…yesterday bandwidth for this small image is like 300MB+

can someone tell me what is wrong?

to post a comment
PHP

7 Comments(s)

Copy linkTweet thisAlerts:
@PunkSktBrdr01Feb 02.2004 — For some things, PNGs can become very large. What's the size (width and height) of the image?
Copy linkTweet thisAlerts:
@tanfwcauthorFeb 02.2004 — 305 * 135
Copy linkTweet thisAlerts:
@PunkSktBrdr01Feb 02.2004 — Well, that seems like a fairly large image. PNGs are often larger (filesize), but they have better quality. If you want to reduce the filesize, try using imagejpeg() instead of imagepng().
Copy linkTweet thisAlerts:
@tanfwcauthorFeb 03.2004 — [i]Originally posted by PunkSktBrdr01 [/i]

[B]Well, that seems like a fairly large image. PNGs are often larger (filesize), but they have better quality. If you want to reduce the filesize, try using imagejpeg() instead of imagepng(). [/B][/QUOTE]


hmmm...just that when i try to push the image to jpeg...it is very blur...i try to decrease the png size coz of my BW...yesterday record is 500MB...
Copy linkTweet thisAlerts:
@PunkSktBrdr01Feb 03.2004 — Try changing the quality setting of [URL=http://us2.php.net/manual/en/function.imagejpeg.php]imagejpeg()[/URL].
Copy linkTweet thisAlerts:
@tanfwcauthorFeb 03.2004 — [i]Originally posted by PunkSktBrdr01 [/i]

[B]Try changing the quality setting of [URL=http://us2.php.net/manual/en/function.imagejpeg.php]imagejpeg()[/URL]. [/B][/QUOTE]


i try liao...the text is very hard to see in that format...
Copy linkTweet thisAlerts:
@tanfwcauthorFeb 06.2004 — anyone can help? pyro...r u on holiday?
×

Success!

Help @tanfwc spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.18,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...