- added sample files missing from MANIFEST
[imager.git] / samples / README
CommitLineData
12b1fac2
TC
1This directory includes example code for Imager.
2
3If you have sample code to contribute, please contact the maintainer.
4
5The notes here just provide a basic description and the functions
6used.
7
8anaglyph.pl
9
10 Produce a color, grey or pure anaglyph image given left and right
11 images of a stereoscopic pair.
12
13 Uses transform2() and convert().
14
1611d101
TC
15replace_color.pl
16
17 Example using Imager::transform2() to replace one color with another
18 in an image.
19
20 http://www.perlmonks.org/?node_id=497355
21
7d148aa3
TC
22inline_replace_color.pl
23
24 Example using Inline::C and the Imager API to replace one color with
25 another in an image.
26
12b1fac2
TC
27interleave.pl
28
29 Produce an interleaved image given the left and right images of a
30 stereoscopic pair. Note that the source images must be pre-scaled.
31
32 This includes 3 different implementations, first using transform2(),
33 the second using the internal i_copyto() function and the third using
34 the internal i_glin() and i_plin() functions.
1a19d068
TC
35
36samp-form.cgi
37samp-image.cgi
38
39 Example that demonstrates generating an image linked from a HTML form.
40
41 The POD for this sample discusses alternate approaches and security
42 considerations.
d2bd6dbc
TC
43
44samp-scale.html
45samp-scale.cgi
46
47 Example that demonstrates reading an image uploaded via a HTML form.
48
49 Produces an output image scaled to fit inside 200x200.
50
51samp-tags.html
52samp-tags.cgi
53
54 Example that demonstrates reading an image uploaded via a HTML form.
55
56 Produces a text/plain report of the tags that Imager defined for the
57 image.
58
59 This and the previous sample are very similar, the intent is to show
60 the common elements and to demonstrate that the output is independent
61 of the input.
62
63 See the section "Parsing an image posted via CGI" in Imager::Cookbook
64 for cautions and details on reading uploaded images.
1611d101 65
98421735
TC
66border.pl
67
68 Example of adding a border to an image.
ef1ab93b
TC
69
70slant_text.pl
71
72 Example of drawing transformed text.
73
74 Draws slanted or rotated text to a new image and saves it to a file.
75
76 As part of this it demonstrates calculating the transformed bounding
77 box of the text.
78
44da52d3
TC
79tk-photo.pl
80
81 Simple example of making a Tk::Photo object using Imager data.
085910c6
TC
82
83align-string.pl
84
85 Simple demonstration of the align_string() method. Usage:
86
87 perl align-string.pl fontfile size outputfile text...
88
89 eg.
90
91 perl align-string.pl fontfiles/ImUgly.ttf 60 test.ppm .A.
92
93 This demonstrates how the various values of halign and valign
94 behave.