source: libcaca/trunk/caca-php/examples/dithering.php @ 3148

Last change on this file since 3148 was 3148, checked in by nico, 12 years ago
  • Remove "_gd" suffix from dithering functions
  • caca_dithering_bitmap can load palette from gd resource
  • Remove caca_set_dither_palette_gd function
  • Adapt sample program "dithering.php"
  • Property svn:executable set to *
File size: 610 bytes
Line 
1#!/usr/bin/php5
2<?php
3$img = imagecreatefrompng(dirname(__FILE__)."/logo-caca.png");
4//$img = imagecreatefromgif(dirname(__FILE__)."/logo-caca-idx.gif");
5if (!$img)
6        die("Can not open image.\n");
7
8$dither = caca_create_dither($img);
9if (!$dither)
10        die("Can not create dither. Maybe this image is not truecolor.\n");
11
12$canvas = caca_create_canvas(0, 0);
13$display = caca_create_display($canvas);
14if (!$display)
15        die("Can not create display.\n");
16
17caca_dither_bitmap($canvas, 0, 0, caca_get_canvas_width($canvas), caca_get_canvas_height($canvas), $dither, $img);
18caca_refresh_display($display);
19
20sleep(5);
21
22?>
Note: See TracBrowser for help on using the repository browser.