Skip to content

Commit

Permalink
testing dithering
Browse files Browse the repository at this point in the history
git-svn-id: http://opus.winelibrary.com/highlite@32 b2180d9d-0f15-4909-a4fa-37428cf2907f
  • Loading branch information
kastner committed Feb 11, 2008
1 parent 0d1a4a5 commit f68c0cb
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions make_selection_ajax.php
Expand Up @@ -46,9 +46,6 @@
$image = imagecreatefrompng($image);
}

// dither the image down to suggested # of colors
imagetruecolortopalette($image, true, $num_colors);

// calculate the width (1:2 the original)
$new_width = $width;
$new_height = ceil(($new_width / $image_width) * $image_height / 2);
Expand All @@ -59,6 +56,9 @@
// squish (or stretch) the image into the new image object
imagecopyresized($image2, $image, 0, 0, 0, 0, $new_width, $new_height, $image_width, $image_height);

// dither the image down to suggested # of colors
imagetruecolortopalette($image2, true, $num_colors);

// pad the text if needed
$text = preg_replace("/\n|\t+/", " ", $text);
$new_text = $text;
Expand Down

0 comments on commit f68c0cb

Please sign in to comment.