!"New" filter |image_format{} :

Hi,

a « new » filter |image_format{} has been introduced to the SVN version :
it saves the image in the chosen format, and keeps its transparency ;
in fact it’s a shortcut for the « transparency » option that has just added ARNO* ([12638]) to the filter |image_aplatir{}

Example :
in inc-head.html, |image_format{ico} for the favicon

Note :
image_aplatir now has the following definition :
function image_aplatir($im, $format=‹ jpg ›, $color=‹ 000000 ›, $quality=NULL, $transparency=false)

$im : the image itself
$format : the format to generate
$color : the background color that normaly replaces the alpha layout
$quality : see below
$transparency : Should the result image keep the transparency of the orginal, when possible (gif, png, ico)

image_aplatir normaly replaces the alpha layout by a specified color ($color). It can be used to change the format or the compression of an image. For such usage, it’s also possible to maintain the transparency with the last parameter. $quality is used like this :

  • For the jpg format, it correspond to the compression level (85 by default)
  • for the gif format, it correspond to the number of colors of the palette (128 by default)
  • for png pictures, $quality corresponds to the number of colors of the palette or, if equal to 0, to a truecolor image(default value)

P.S. : commit concerned :
[12640] : http://trac.rezo.net/trac/spip/changeset/12640

.Gilles