You are here: Re: setting imagecreatetruecolor() to have transparency as default « PHP Programming Language « IT news, forums, messages
Re: setting imagecreatetruecolor() to have transparency as default

Posted by Chamomile on 05/22/06 19:02

>
> It's mentioned in the user comments in php.net manual page:
> http://fi.php.net/manual/en/function.imagecreatetruecolor.php#54025
>
> // Creates a transparent image rather than the default black image
> function imageCreateTransparent($x, $y) {
> $imageOut = imagecreate($x, $y);
> $colourBlack = imagecolorallocate($imageOut, 0, 0, 0);
> imagecolortransparent($imageOut, $colourBlack);
> return $imageOut;
> }
>
> HTH
>
> --
> "ohjelmoija on organismi joka muuttaa kofeiinia koodiksi" -lpk
> spam@outolempi.net | Gedoon-S @ IRCnet | rot13(xvzzb@bhgbyrzcv.arg)
>
>
Yes, thanks - I came accross that.
The problem is, it only makes a non-truecolor image which is no good for my
purposes
as I am downsampling with imagecopyresample() in order to get 'aliased'
curve fills at small sizes.
- downsampling an image made using imagecreate() gives jagged curves,
whereas downsampling using imagecreatetruecolor() gives good smoothing.
Unfotunately it seems once an image has ever been truecolor - even if you
theoretically set it back to paletted colors
(as far as I can see with experimentation) you cannot re-set the
transparency of the 'black' areas.

It seems to be a choice between smoothed curves or transparency - not both!

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация