<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://weblogs.asp.net/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>What InterpolationMode and CompositingQuality to use when generating thumbnails via System.Drawing</title><link>http://weblogs.asp.net/bleroy/archive/2007/12/05/what-interpolationmode-and-compositingquality-to-use-when-generating-thumbnails-via-system-drawing.aspx</link><description>For some reason I keep writing photo thumbnail generators lately. The last time was this week for an internal app building contest. One thing that I never seriously investigated before was how to optimize the quality of the generated thumbnails. So today</description><dc:language>en</dc:language><generator>CommunityServer 2007 SP1 (Build: 20510.895)</generator><item><title>re: What InterpolationMode and CompositingQuality to use when generating thumbnails via System.Drawing</title><link>http://weblogs.asp.net/bleroy/archive/2007/12/05/what-interpolationmode-and-compositingquality-to-use-when-generating-thumbnails-via-system-drawing.aspx#6667668</link><pubDate>Thu, 09 Oct 2008 21:57:35 GMT</pubDate><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:6667668</guid><dc:creator>nathanaeljones</dc:creator><author>nathanaeljones</author><description>&lt;p&gt;Cool! I recently read the article, but hadn&amp;#39;t realized you wrote it. &lt;/p&gt;
&lt;p&gt;I usually have my photos in the same directory with the .aspx file that contain them, so putting everything in a photos folder would be a severe disadvantage... I like relative paths :).&lt;/p&gt;
&lt;p&gt;MapPath completely ignores the security and access settings in the URL authorization portion of web.config. Since that&amp;#39;s the easiest way to protect static files, it&amp;#39;s nice to support it. Integrating as HttpHandler makes that compatibility automatic.&lt;/p&gt;
&lt;p&gt;I also use a *wide* variety of thumbnail sizes, so having them all the same wouldn&amp;#39;t benefit me much. I often need several versions of the same file, so the caching system needs to be that flexible also. &lt;/p&gt;
&lt;p&gt;I also implemented automatic cache management to prevent denial of service attacks... you can read my comment at &lt;a rel="nofollow" target="_new" href="http://nathanaeljones.com/products/asp-net-image-resizer/"&gt;nathanaeljones.com/.../asp-net-image-resizer&lt;/a&gt;&lt;/p&gt;
&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=6667668" width="1" height="1"&gt;</description></item><item><title>re: What InterpolationMode and CompositingQuality to use when generating thumbnails via System.Drawing</title><link>http://weblogs.asp.net/bleroy/archive/2007/12/05/what-interpolationmode-and-compositingquality-to-use-when-generating-thumbnails-via-system-drawing.aspx#6667623</link><pubDate>Thu, 09 Oct 2008 21:08:33 GMT</pubDate><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:6667623</guid><dc:creator>Bertrand Le Roy</dc:creator><author>Bertrand Le Roy</author><description>&lt;p&gt;@Nathanael: well, yes, I also wrote this, which explains how to do the same thing:&lt;/p&gt;
&lt;p&gt;&lt;a rel="nofollow" target="_new" href="http://weblogs.asp.net/bleroy/archive/2008/06/20/generating-thumbnails-in-asp-net-dotnetslackers.aspx"&gt;weblogs.asp.net/.../generating-thumbnails-in-asp-net-dotnetslackers.aspx&lt;/a&gt;&lt;/p&gt;
&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=6667623" width="1" height="1"&gt;</description></item><item><title>re: What InterpolationMode and CompositingQuality to use when generating thumbnails via System.Drawing</title><link>http://weblogs.asp.net/bleroy/archive/2007/12/05/what-interpolationmode-and-compositingquality-to-use-when-generating-thumbnails-via-system-drawing.aspx#6667599</link><pubDate>Thu, 09 Oct 2008 20:49:41 GMT</pubDate><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:6667599</guid><dc:creator>nathanaeljones</dc:creator><author>nathanaeljones</author><description>&lt;p&gt;You might be interested in this image resizing module, then.&lt;/p&gt;
&lt;p&gt;It integrates with the pipeline, so you can just slap a query string onto any image URL to get it resized or converted: &lt;/p&gt;
&lt;p&gt;image.jpg?thumbnail=jpg&amp;amp;maxwidth=30&lt;/p&gt;
&lt;p&gt;It also permanently caches resized versions to disk... otherwise you run into serious scalability issues. With disk caching it&amp;#39;s practical to use this on high-load production servers.&lt;/p&gt;
&lt;p&gt;Take a look:&lt;/p&gt;
&lt;p&gt;&lt;a rel="nofollow" target="_new" href="http://nathanaeljones.com/products/asp-net-image-resizer/"&gt;nathanaeljones.com/.../asp-net-image-resizer&lt;/a&gt;&lt;/p&gt;
&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=6667599" width="1" height="1"&gt;</description></item><item><title>Image Capture and Auto-Resize With Cropper</title><link>http://weblogs.asp.net/bleroy/archive/2007/12/05/what-interpolationmode-and-compositingquality-to-use-when-generating-thumbnails-via-system-drawing.aspx#6252623</link><pubDate>Fri, 06 Jun 2008 10:46:59 GMT</pubDate><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:6252623</guid><dc:creator>Mike Ormond's Blog</dc:creator><author>Mike Ormond's Blog</author><description>&lt;p&gt;Having talked about the pain of capturing image snapshots , someone mentioned Cropper and its plug-in&lt;/p&gt;
&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=6252623" width="1" height="1"&gt;</description></item><item><title>re: What InterpolationMode and CompositingQuality to use when generating thumbnails via System.Drawing</title><link>http://weblogs.asp.net/bleroy/archive/2007/12/05/what-interpolationmode-and-compositingquality-to-use-when-generating-thumbnails-via-system-drawing.aspx#5505800</link><pubDate>Thu, 27 Dec 2007 00:09:08 GMT</pubDate><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:5505800</guid><dc:creator>Thomas</dc:creator><author>Thomas</author><description>&lt;p&gt;can someone please post a code sample on how to do this resizing using the Paint.net api, I downloaded the source code and it&amp;#39;s an abyss of functions that are not documented and don&amp;#39;t even bother posting on their forum so far they&amp;#39;ve been less than helpful.&lt;/p&gt;
&lt;p&gt;I&amp;#39;d truly appreciate it. &lt;/p&gt;
&lt;p&gt;thanks&lt;/p&gt;
&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=5505800" width="1" height="1"&gt;</description></item><item><title>re: What InterpolationMode and CompositingQuality to use when generating thumbnails via System.Drawing</title><link>http://weblogs.asp.net/bleroy/archive/2007/12/05/what-interpolationmode-and-compositingquality-to-use-when-generating-thumbnails-via-system-drawing.aspx#5440616</link><pubDate>Wed, 12 Dec 2007 01:59:06 GMT</pubDate><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:5440616</guid><dc:creator>Bertrand Le Roy</dc:creator><author>Bertrand Le Roy</author><description>&lt;p&gt;Rick: thanks for the info! Cheers!&lt;/p&gt;
&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=5440616" width="1" height="1"&gt;</description></item><item><title>re: What InterpolationMode and CompositingQuality to use when generating thumbnails via System.Drawing</title><link>http://weblogs.asp.net/bleroy/archive/2007/12/05/what-interpolationmode-and-compositingquality-to-use-when-generating-thumbnails-via-system-drawing.aspx#5440495</link><pubDate>Wed, 12 Dec 2007 01:27:58 GMT</pubDate><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:5440495</guid><dc:creator>Rick Brewster</dc:creator><author>Rick Brewster</author><description>&lt;p&gt;Paint.NET uses its own code for resampling. There are issues with the underlying GDI+ library when trying to use some of System.Drawing&amp;#39;s interpolation modes. It quite often makes the border pixels slightly transparent. Or it makes things blurry like you documented here.&lt;/p&gt;
&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=5440495" width="1" height="1"&gt;</description></item><item><title>re: What InterpolationMode and CompositingQuality to use when generating thumbnails via System.Drawing</title><link>http://weblogs.asp.net/bleroy/archive/2007/12/05/what-interpolationmode-and-compositingquality-to-use-when-generating-thumbnails-via-system-drawing.aspx#5433285</link><pubDate>Mon, 10 Dec 2007 19:27:54 GMT</pubDate><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:5433285</guid><dc:creator>Bertrand Le Roy</dc:creator><author>Bertrand Le Roy</author><description>&lt;p&gt;Lionel, that is very good info. Thanks a lot.&lt;/p&gt;
&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=5433285" width="1" height="1"&gt;</description></item><item><title>re: What InterpolationMode and CompositingQuality to use when generating thumbnails via System.Drawing</title><link>http://weblogs.asp.net/bleroy/archive/2007/12/05/what-interpolationmode-and-compositingquality-to-use-when-generating-thumbnails-via-system-drawing.aspx#5432691</link><pubDate>Mon, 10 Dec 2007 17:04:20 GMT</pubDate><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:5432691</guid><dc:creator>Lionel</dc:creator><author>Lionel</author><description>&lt;p&gt;Actually, you can get nearly the same result as Photoshop&amp;#39;s &amp;quot;Bicubic sharper&amp;quot; using Paint.NET. &amp;nbsp;Here is the method:&lt;/p&gt;
&lt;p&gt;1. Apply a Gaussian blur (with radius 2)&lt;/p&gt;
&lt;p&gt;2. Resize using Best Quality/Supersampling (to 134x100 pixels)&lt;/p&gt;
&lt;p&gt;3. Apply a &amp;quot;Sharpen&amp;quot; effect (with radius 2).&lt;/p&gt;
&lt;p&gt;The Gaussian blur avoids moir&amp;#233; patterns, and the final sharpening increases the _apparent_ sharpness of the image (see &lt;a rel="nofollow" target="_new" href="http://en.wikipedia.org/wiki/Unsharp_masking"&gt;en.wikipedia.org/.../Unsharp_masking&lt;/a&gt; for how it works). &amp;nbsp;Both would be rather easy to implement in a standalone assembly.&lt;/p&gt;
&lt;p&gt;The visual effect is nice, but the is some cheating involved: even if it looks nicer, the blur+sharpening actually further degrades the image.&lt;/p&gt;
&lt;p&gt;As for Lanczos resampling and other high order methods, it looks like they are much more suited to encreasing the resolution of the image. &amp;nbsp;For making small thumbnails, it looks like very little is gained.&lt;/p&gt;
&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=5432691" width="1" height="1"&gt;</description></item><item><title>re: What InterpolationMode and CompositingQuality to use when generating thumbnails via System.Drawing</title><link>http://weblogs.asp.net/bleroy/archive/2007/12/05/what-interpolationmode-and-compositingquality-to-use-when-generating-thumbnails-via-system-drawing.aspx#5414575</link><pubDate>Thu, 06 Dec 2007 23:23:00 GMT</pubDate><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:5414575</guid><dc:creator>Bertrand Le Roy</dc:creator><author>Bertrand Le Roy</author><description>&lt;p&gt;My point exactly, Morten, although the differences between the compressed versions are still very visible. But there are only 24 hours a day and those will have to wait a bit.&lt;/p&gt;
&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=5414575" width="1" height="1"&gt;</description></item></channel></rss>