je créer une image
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
header ("Content-type: image/jpg");
$image_carte = imagecreatefromjpeg("fond_carte.jpg");
$background = imagecolorallocate($image_carte,153, 153, 153);
 
//Lignes horizontales
imageline($image_carte, 0, 0, 549, 0, $background);
imageline($image_carte, 0, 110, 549, 110, $background);
imageline($image_carte, 0, 220, 549, 220, $background);
imageline($image_carte, 0, 330, 549, 330, $background);
imageline($image_carte, 0, 440, 549, 440, $background);
imageline($image_carte, 0, 549, 549, 549, $background);
//Lignes verticales
imageline($image_carte, 0, 0, 0, 549, $background);
imageline($image_carte, 110, 0, 110, 549, $background);
imageline($image_carte, 220, 0, 220, 549, $background);
imageline($image_carte, 330, 0, 330, 549, $background);
imageline($image_carte, 440, 0, 440, 549, $background);
imageline($image_carte, 549, 0, 549, 549, $background);
 
imagepng($image_carte, "galaxie.png");
imagedestroy($image_carte);
voir : http://test.derniere-bataille.net/carte_galaxie/galaxie.php

mon pb c'est que l'image 'galaxie.png' fait plus de 315ko a l'arrivée et celle de départ 'fond_carte.jpg' en fait 85ko ...

est il possible d'optimiser l'image recréée ?