<?xml version="1.0"?>
<rss version="2.0">
	<channel>
		<title>Image Manipulation (Enlargement)</title>
		<link>http://www.allegro.cc/forums/view/587818</link>
		<description>Allegro.cc Forum Thread</description>
		<webMaster>matthew@allegro.cc (Matthew Leverton)</webMaster>
		<lastBuildDate>Tue, 03 Oct 2006 13:30:35 +0000</lastBuildDate>
	</channel>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>I&#39;ve got a couple of old photographs that I&#39;d like to digitally enlarge. I was wondering if anyone knows of any good techniques or software that will let me enlarge the image while keeping it (relatively) free of blur. I&#39;m not looking for a major size increase. </p><p>I&#39;ve got Photoshop and that usually does a nice job, but I just wanted to ask about any special software you guys may know about.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (ngiacomelli)</author>
		<pubDate>Sun, 01 Oct 2006 18:53:49 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>I think there&#39;s no way to scale an image without blurring it.<br />Configurate Photoshop to use bicubic filtering and then scale it.<br />I don&#39;t see other options. (All the image manupulation software I know has linear and bicubic filtering.)
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Mr. Big)</author>
		<pubDate>Sun, 01 Oct 2006 19:05:46 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>
There are some programs out there which can use several routines to enlarge images. Although I don&#39;t think there is one magic routine here..</p><p>Try searching for Lanczos.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Richard Phipps)</author>
		<pubDate>Sun, 01 Oct 2006 19:21:34 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>I thought they had pills for that <img src="http://www.allegro.cc/forums/smileys/grin.gif" alt=";D" />
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Steve Terry)</author>
		<pubDate>Sun, 01 Oct 2006 19:31:09 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Haha, I knew this would someday be useful: <a href="http://www.cambridgeincolour.com/tutorials/digital-photo-enlargement.htm">http://www.cambridgeincolour.com/tutorials/digital-photo-enlargement.htm</a></p><p>There&#39;s specialized software available for specifically for enlarging photographs that does a very good job. According to the above linked page &quot;GenuineFractals&quot; is the best one. Bicubic and Lanczos and similar are general purpose algorithms that do reasonably well for all types of images but aren&#39;t really that good for any one particular type.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (miran)</author>
		<pubDate>Sun, 01 Oct 2006 19:33:43 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><div class="quote_container"><div class="title">Quote:</div><div class="quote"><p>
I thought they had pills for that <img src="http://www.allegro.cc/forums/smileys/grin.gif" alt=";D" />
</p></div></div><p>

They Do! I was running for the toilet every 5 minutes all day and night it was terrible
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Number Six)</author>
		<pubDate>Sun, 01 Oct 2006 19:55:50 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Just use allegro and stretch_blit it, or use a vector approach and blit it point/point onto a new bitmap.</p><p>It is just a few code lines.</p><p>example: EDIT: TESTED and working OK
</p><div class="source-code"><div class="toolbar"></div><div class="inner"><table width="100%"><tbody><tr><td class="number">1</td><td><span class="p">#include &lt;allegro.h&gt;</span></td></tr><tr><td class="number">2</td><td>&#160;</td></tr><tr><td class="number">3</td><td><a href="http://www.allegro.cc/manual/BITMAP" target="_blank"><span class="a">BITMAP</span></a> <span class="k3">*</span>loaded, <span class="k3">*</span>new_one<span class="k2">;</span></td></tr><tr><td class="number">4</td><td>&#160;</td></tr><tr><td class="number">5</td><td><span class="k1">int</span> W<span class="k3">=</span><span class="n">0</span>,H<span class="k3">=</span><span class="n">0</span>, <span class="c">/* new_one bitmap size */</span></td></tr><tr><td class="number">6</td><td>    x<span class="k3">=</span><span class="n">0</span>,y<span class="k3">=</span><span class="n">0</span><span class="k2">;</span> <span class="c">/* iterators */</span></td></tr><tr><td class="number">7</td><td> </td></tr><tr><td class="number">8</td><td><span class="k1">char</span> new_name<span class="k2">[</span><span class="n">512</span><span class="k2">]</span><span class="k2">;</span></td></tr><tr><td class="number">9</td><td>&#160;</td></tr><tr><td class="number">10</td><td><span class="k1">int</span> main<span class="k2">(</span> <span class="k1">int</span> argc , <span class="k1">char</span> <span class="k3">*</span>argv<span class="k2">[</span><span class="k2">]</span> <span class="k2">)</span><span class="k2">{</span></td></tr><tr><td class="number">11</td><td>&#160;</td></tr><tr><td class="number">12</td><td><span class="k1">if</span><span class="k2">(</span> argc <span class="k3">&lt;</span> <span class="n">2</span> <span class="k2">)</span> </td></tr><tr><td class="number">13</td><td><span class="k1">return</span> <span class="k3">-</span><span class="n">1</span><span class="k2">;</span> <span class="c">/* no parameter */</span></td></tr><tr><td class="number">14</td><td>&#160;</td></tr><tr><td class="number">15</td><td><a href="http://www.allegro.cc/manual/set_color_depth" target="_blank"><span class="a">set_color_depth</span></a><span class="k2">(</span> <span class="n">32</span> <span class="k2">)</span><span class="k2">;</span></td></tr><tr><td class="number">16</td><td>&#160;</td></tr><tr><td class="number">17</td><td><a href="http://www.allegro.cc/manual/allegro_init" target="_blank"><span class="a">allegro_init</span></a><span class="k2">(</span><span class="k2">)</span><span class="k2">;</span></td></tr><tr><td class="number">18</td><td>&#160;</td></tr><tr><td class="number">19</td><td>loaded <span class="k3">=</span> <a href="http://www.allegro.cc/manual/load_bitmap" target="_blank"><span class="a">load_bitmap</span></a><span class="k2">(</span> argv<span class="k2">[</span><span class="n">1</span><span class="k2">]</span> , NULL <span class="k2">)</span><span class="k2">;</span></td></tr><tr><td class="number">20</td><td>&#160;</td></tr><tr><td class="number">21</td><td><span class="k1">if</span><span class="k2">(</span> <span class="k3">!</span>loaded <span class="k2">)</span></td></tr><tr><td class="number">22</td><td><span class="k1">return</span> <span class="k3">-</span><span class="n">1</span><span class="k2">;</span> <span class="c">/* invalid filename or corrupted bitmap */</span></td></tr><tr><td class="number">23</td><td>&#160;</td></tr><tr><td class="number">24</td><td><a href="http://www.delorie.com/djgpp/doc/libc/libc_624.html" target="_blank">printf</a><span class="k2">(</span> <span class="s">"\nX Size is: %d , Enter new X size:"</span> , loaded <span class="k3">-</span><span class="k3">&gt;</span> w <span class="k2">)</span><span class="k2">;</span></td></tr><tr><td class="number">25</td><td>&#160;</td></tr><tr><td class="number">26</td><td><a href="http://www.delorie.com/djgpp/doc/libc/libc_670.html" target="_blank">scanf</a><span class="k2">(</span> <span class="s">"%d"</span> , <span class="k3">&amp;</span>W <span class="k2">)</span><span class="k2">;</span></td></tr><tr><td class="number">27</td><td>&#160;</td></tr><tr><td class="number">28</td><td><a href="http://www.delorie.com/djgpp/doc/libc/libc_624.html" target="_blank">printf</a><span class="k2">(</span> <span class="s">"\nY Size is: %d , Enter new Y size:"</span> , loaded <span class="k3">-</span><span class="k3">&gt;</span> h <span class="k2">)</span><span class="k2">;</span></td></tr><tr><td class="number">29</td><td>&#160;</td></tr><tr><td class="number">30</td><td>&#160;</td></tr><tr><td class="number">31</td><td><a href="http://www.delorie.com/djgpp/doc/libc/libc_670.html" target="_blank">scanf</a><span class="k2">(</span> <span class="s">"%d"</span> , <span class="k3">&amp;</span>H <span class="k2">)</span><span class="k2">;</span></td></tr><tr><td class="number">32</td><td>&#160;</td></tr><tr><td class="number">33</td><td><span class="k1">if</span><span class="k2">(</span> W <span class="k3">&lt;</span><span class="k3">=</span> <span class="n">0</span> <span class="k3">|</span><span class="k3">|</span> H <span class="k3">&lt;</span><span class="k3">=</span> <span class="n">0</span> <span class="k2">)</span></td></tr><tr><td class="number">34</td><td><span class="k1">return</span> <span class="k3">-</span><span class="n">1</span><span class="k2">;</span> <span class="c">/* out of range values */</span></td></tr><tr><td class="number">35</td><td>&#160;</td></tr><tr><td class="number">36</td><td>new_one <span class="k3">=</span> <a href="http://www.allegro.cc/manual/create_bitmap" target="_blank"><span class="a">create_bitmap</span></a><span class="k2">(</span> W , H <span class="k2">)</span><span class="k2">;</span></td></tr><tr><td class="number">37</td><td>&#160;</td></tr><tr><td class="number">38</td><td><span class="k1">if</span><span class="k2">(</span> <span class="k3">!</span>new_one <span class="k2">)</span></td></tr><tr><td class="number">39</td><td><span class="k1">return</span> <span class="k3">-</span><span class="n">1</span><span class="k2">;</span> <span class="c">/* error creating */</span></td></tr><tr><td class="number">40</td><td>&#160;</td></tr><tr><td class="number">41</td><td>clear<span class="k2">(</span> new_one <span class="k2">)</span><span class="k2">;</span></td></tr><tr><td class="number">42</td><td>&#160;</td></tr><tr><td class="number">43</td><td><span class="k1">for</span><span class="k2">(</span> x <span class="k3">=</span> <span class="n">0</span> <span class="k2">;</span> x <span class="k3">&lt;</span> W <span class="k2">;</span> x <span class="k3">+</span><span class="k3">+</span> <span class="k2">)</span><span class="k2">{</span></td></tr><tr><td class="number">44</td><td><span class="k1">for</span><span class="k2">(</span> y <span class="k3">=</span> <span class="n">0</span> <span class="k2">;</span> y <span class="k3">&lt;</span> H <span class="k2">;</span> y <span class="k3">+</span><span class="k3">+</span> <span class="k2">)</span><span class="k2">{</span></td></tr><tr><td class="number">45</td><td><a href="http://www.allegro.cc/manual/putpixel" target="_blank"><span class="a">putpixel</span></a><span class="k2">(</span> new_one , x , y , <a href="http://www.allegro.cc/manual/getpixel" target="_blank"><span class="a">getpixel</span></a><span class="k2">(</span> loaded , <span class="k2">(</span>x <span class="k3">*</span> loaded <span class="k3">-</span><span class="k3">&gt;</span> w <span class="k2">)</span> <span class="k3">/</span> W , <span class="k2">(</span>y <span class="k3">*</span> loaded <span class="k3">-</span><span class="k3">&gt;</span> h<span class="k2">)</span> <span class="k3">/</span> H <span class="k2">)</span> <span class="k2">)</span><span class="k2">;</span></td></tr><tr><td class="number">46</td><td><span class="k2">}</span></td></tr><tr><td class="number">47</td><td><span class="k2">}</span></td></tr><tr><td class="number">48</td><td>&#160;</td></tr><tr><td class="number">49</td><td><a href="http://www.delorie.com/djgpp/doc/libc/libc_737.html" target="_blank">sprintf</a><span class="k2">(</span> new_name , <span class="s">"new_%s"</span> , argv<span class="k2">[</span><span class="n">1</span><span class="k2">]</span> <span class="k2">)</span><span class="k2">;</span></td></tr><tr><td class="number">50</td><td>&#160;</td></tr><tr><td class="number">51</td><td><a href="http://www.allegro.cc/manual/save_bmp" target="_blank"><span class="a">save_bmp</span></a><span class="k2">(</span> new_name , new_one , NULL <span class="k2">)</span><span class="k2">;</span></td></tr><tr><td class="number">52</td><td>&#160;</td></tr><tr><td class="number">53</td><td><a href="http://www.allegro.cc/manual/destroy_bitmap" target="_blank"><span class="a">destroy_bitmap</span></a><span class="k2">(</span> new_one <span class="k2">)</span><span class="k2">;</span></td></tr><tr><td class="number">54</td><td><a href="http://www.allegro.cc/manual/destroy_bitmap" target="_blank"><span class="a">destroy_bitmap</span></a><span class="k2">(</span> loaded  <span class="k2">)</span><span class="k2">;</span></td></tr><tr><td class="number">55</td><td>&#160;</td></tr><tr><td class="number">56</td><td><a href="http://www.allegro.cc/manual/allegro_exit" target="_blank"><span class="a">allegro_exit</span></a><span class="k2">(</span><span class="k2">)</span><span class="k2">;</span></td></tr><tr><td class="number">57</td><td>&#160;</td></tr><tr><td class="number">58</td><td><span class="k2">}</span><a href="http://www.allegro.cc/manual/END_OF_MAIN" target="_blank"><span class="a">END_OF_MAIN</span></a><span class="k2">(</span><span class="k2">)</span><span class="k2">;</span></td></tr></tbody></table></div></div><p>
 <br />Attached is a windows binary. </p><p>Usage is: test.exe name_of_bitmap_to_modify.bmp</p><p>After what you enter the new X and Y size and it will save your bitmap.</p><p>It just quit if any error occur.</p><p>EDIT2: Do not use it with /path/bitmap_name.bmp, because in this case it will try to save it under new_/path/bitmap_name.bmp.</p><p>_
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (GullRaDriel)</author>
		<pubDate>Mon, 02 Oct 2006 20:15:34 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Gulldrididi: Did you read the page I posted a link to? There are so many methods that are infinitely better than simple scaling, that your post isn&#39;t even funny anymore...
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (miran)</author>
		<pubDate>Mon, 02 Oct 2006 20:52:24 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>
For once.. (sigh).. I have to agree with Miran.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Richard Phipps)</author>
		<pubDate>Mon, 02 Oct 2006 22:44:50 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>The OP was wanting to keep his picture free of blur. It&#39;s done by the way I gave. My post was not made to be funny. And please spell my name correctly, or just call me Gull <img src="http://www.allegro.cc/forums/smileys/undecided.gif" alt=":-/" /></p><p>And yeah, I have already read the whole link you gave before posting. As I said, I just give my way because of the need of non-blurred picture. If he have a sprite to enlarge and if he do not want a pink halo around it, he should not use any interpolation.</p><p>Finally, I was thinking that posting a few line of code can not be that bad.</p><p>M.Phipps, are you sure that you are not agreeing just for the sake of it ? hum hum.<br />_
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (GullRaDriel)</author>
		<pubDate>Tue, 03 Oct 2006 12:51:15 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Sorry for not knowing how to spell your name, but it&#39;s just so nonsensical... <img src="http://www.allegro.cc/forums/smileys/tongue.gif" alt=":P" /></p><div class="quote_container"><div class="title">Quote:</div><div class="quote"><p>
And yeah, I have already read the whole link you gave before posting. As I said, I just give my way because of the need of non-blurred picture.
</p></div></div><p>
But did you look at the sample pictures? There&#39;s a direct comparison between your method and several others (you need to hover the mouse over the links so the pictures update!) The specialized fractal/vector algorithms do not produce blur and look by far better than the pixelized look of simple scaling.</p><div class="quote_container"><div class="title">Quote:</div><div class="quote"><p>
If he have a sprite to enlarge and if he do not want a pink halo around it, he should not use any interpolation.
</p></div></div><p>
He has a few old photographs <img src="http://www.allegro.cc/forums/smileys/rolleyes.gif" alt="::)" /> And if he did want to enlarge sprites, the other methods are still better. Just look at that breakout game Phipps made a while ago...</p><div class="quote_container"><div class="title">Quote:</div><div class="quote"><p>
Finally, I was thinking that posting a few line of code can not be that bad.
</p></div></div><p>
This is certainly a good thing. <img src="http://www.allegro.cc/forums/smileys/smiley.gif" alt=":)" />
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (miran)</author>
		<pubDate>Tue, 03 Oct 2006 13:03:57 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Now, it is a classified story/case ;-)
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (GullRaDriel)</author>
		<pubDate>Tue, 03 Oct 2006 13:15:15 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>
Simple pixel resize looks horrible unless the output size is an exact multiple (i.e. x2, x3, x4). Even then it doesn&#39;t look good for photographs.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Richard Phipps)</author>
		<pubDate>Tue, 03 Oct 2006 13:27:00 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Using some bilinear or bicubic interpolation when enlarging shouldn&#39;t be called blurring, even though the result looks kind of blurred, compared to nearest neighbour methods (allegro stretch_blit()). Blurring is what you add to a picture, when you don&#39;t change the seize. And when you blur, you lose information, when you just want to smoothen some sharp details. You may use stretch_blit() and then you may blur, but you might not end up in same result.</p><p>Take a 1024*768 image (digital photo) and scale it down to 256*192. Then make one copy that you scale back to 1024*768 using some bicubic interpolation. Make another copy using &quot;non blurring&quot; stretch_blit(). The former is definitely more near the original. That&#39;s why it is stupid to talk about blurring when upscaling using bicubic interpolation.</p><p>If your old photograps are on photo paper, use the best scanner you can get. Hopefully you can turn the whole issue into a downscaling issue. If they are digital images, you have to stick with the stuff on the page Miran linked to.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Johan Halmén)</author>
		<pubDate>Tue, 03 Oct 2006 13:30:35 +0000</pubDate>
	</item>
</rss>
