<?xml version="1.0" encoding="iso-8859-1"?>
<feed xmlns="http://www.w3.org/2005/Atom">
<title>Comments on article "Inserting legend in images using PIL"</title>
<link rel="alternate" type="text/html" href="http://base-art.net/Articles/30/" />
<updated>2005-02-12T08:44:25Z</updated>
<author>
  <name>Philippe Normand</name>
</author>
<id>urn:md5:11329</id>
<generator uri="http://pythonfr.org/">Alinea</generator>



<entry>
<title>Fredrik on Inserting legend in images using PIL</title>
<author>
<name>Fredrik</name>
</author>
<link rel="alternate" type="text/html" href="http://base-art.net/Comments/95/"/>
<id>http://base-art.net/Comments/95/</id>
<updated>2005-02-12T08:44:25Z</updated>
<content type="html">
&lt;p&gt;&lt;a class="reference" href="http://toolbar.google.com/"&gt;http://toolbar.google.com/&lt;/a&gt;&lt;/p&gt;

</content>
</entry>

<entry>
<title>phil on Inserting legend in images using PIL</title>
<author>
<name>phil</name>
</author>
<link rel="alternate" type="text/html" href="http://base-art.net/Comments/94/"/>
<id>http://base-art.net/Comments/94/</id>
<updated>2005-02-11T23:06:22Z</updated>
<content type="html">
&lt;p&gt;Fredrik,&lt;/p&gt;
&lt;p&gt;Thanks for the explanation about RGB.&lt;/p&gt;
&lt;p&gt;About popups, i'm not that surprised about IE's popup blocker but can you explain the second part of the note :&lt;/p&gt;
&lt;pre class="literal-block"&gt;
neither the built-in variant nor the google bar likes your popup window
&lt;/pre&gt;

</content>
</entry>

<entry>
<title>Fredrik on Inserting legend in images using PIL</title>
<author>
<name>Fredrik</name>
</author>
<link rel="alternate" type="text/html" href="http://base-art.net/Comments/93/"/>
<id>http://base-art.net/Comments/93/</id>
<updated>2005-02-11T20:05:35Z</updated>
<content type="html">
&lt;p&gt;Since you're pasting RGB data on top of the image, the target image has to be an RGB (or RGBA) image as well.  GIF always contains 8-bit palette data, JPEG is almost always RGB (and never ever palette data).  To make sure you have an RGB image, add&lt;/p&gt;
&lt;blockquote&gt;
&lt;dl class="docutils"&gt;
&lt;dt&gt;if image.mode != &amp;quot;RGB&amp;quot;:&lt;/dt&gt;
&lt;dd&gt;image = image.convert(&amp;quot;RGB&amp;quot;)&lt;/dd&gt;
&lt;/dl&gt;
&lt;/blockquote&gt;
&lt;p&gt;to the appropriate place.&lt;/p&gt;
&lt;p&gt;(btw, your preview function isn't compatible with IE's popup blockers (neither the built-in variant nor the google bar likes your popup window)).&lt;/p&gt;

</content>
</entry>

<entry>
<title>phil on Inserting legend in images using PIL</title>
<author>
<name>phil</name>
</author>
<link rel="alternate" type="text/html" href="http://base-art.net/Comments/92/"/>
<id>http://base-art.net/Comments/92/</id>
<updated>2005-02-10T12:09:36Z</updated>
<content type="html">
&lt;p&gt;I only tested the script with jpeg images, i'll try to make it more compatible with other image formats .. And also i need to handle the case where the legend dimensions don't fit in the image.&lt;/p&gt;

</content>
</entry>

<entry>
<title>Mike Watkins on Inserting legend in images using PIL</title>
<author>
<name>Mike Watkins</name>
</author>
<link rel="alternate" type="text/html" href="http://base-art.net/Comments/91/"/>
<id>http://base-art.net/Comments/91/</id>
<updated>2005-02-09T18:41:02Z</updated>
<content type="html">
&lt;p&gt;ps, converted image to jpg - success; png form of same - failure - although an image is generated. File sizes expand quite a bit, particularly on the png so I presume its the output pre-compression or something like that. Image manipulation is not one of my fortes but I'll keep digging. Thanks for the head start...&lt;/p&gt;

</content>
</entry>

<entry>
<title>Mike Watkins on Inserting legend in images using PIL</title>
<author>
<name>Mike Watkins</name>
</author>
<link rel="alternate" type="text/html" href="http://base-art.net/Comments/89/"/>
<id>http://base-art.net/Comments/89/</id>
<updated>2005-02-09T17:55:05Z</updated>
<content type="html">
Thanks for your example - I've been meaning to pick up PIL for a drive and this may kickstart me. I fed your script a 441px x 336px GIF image and got this - any suggestions for a first look?&lt;br/&gt;&lt;br/&gt;Traceback (most recent call last):&lt;br/&gt;&amp;nbsp; File "../test.py", line 80, in ?&lt;br/&gt;&amp;nbsp; &amp;nbsp; annotate(image, text, destination, font)&lt;br/&gt;&amp;nbsp; File "../test.py", line 54, in annotate&lt;br/&gt;&amp;nbsp; &amp;nbsp; inboundBox = Image.blend(inboundBox, textBox, 0.5) &lt;br/&gt;&amp;nbsp; File "/usr/local/lib/python2.4/site-packages/PIL/Image.py", line 1599, in blend&lt;br/&gt;&amp;nbsp; &amp;nbsp; return im1._new(core.blend(im1.im, im2.im, alpha))&lt;br/&gt;ValueError: images do not match&lt;br/&gt;
</content>
</entry>


</feed>