Server-side Image Resizing Module for ASP.NET, ASP, & PHP/IIS

Open-source image resizing module for ASP.NET. Great for thumbnails and slideshows. Features managed disk caching, jpeg/png/gif support, and bicubic resizing.

Server-side image resizing is one of those tiny features that can have incredible ROI. It can save webmasters several hours each day, and gives you the ability to change the resolution of an image without having to hunt up the original. However, many of the approaches currently on the web don't take security or performance into account.
Download Source ($69)

v1.0 - August 6, 2008

v1.2 - Nov 23, 2008

v2.0 alpha -Mar 1, 2009 (by request)

View License Documentation If you have any questions after reading the documentation, leave a comment or e-mail [email protected].
I developed this image resizing system about a year and a half ago. I wanted something very intuitive, simple, secure, and efficient. We've been using this system heavily on a live, high-traffic site ( for over a year, and we have had zero stability problems, memory leaks, or other issues with it. It's very mature and stable. Although I typically release my components for free, I decided to charge a 'download fee' for this one to help support my other open-source projects. Don't worry, this component is still open-source, and the license permits source redistribution as part of a larger system. However, I'm asking that people who want to integrate this component purchase the download instead of ripping it out of another open-source project. My free to non-free LOC (lines of code) ratio is still over 40 to 1, and I plan on keeping it that way. I trust this will keep everybody happy.


  • Querystring-based resizing: image.jpg?width=100
    • ?format=jpg|png|gif — Changes the output format. (This was 'thumbnail' in v1.0).
    • &maxwidth=value&maxheight=value — Specify the maximum size for the resized image. Aspect ratio is maintained. You don't have to use both maxwidth and maxheight - you can use just one.
    • &height=value&width=value — If used together, these will force the image to be stretched to the new dimensions. If height or width is used by itself, aspect ratio is maintained.
    • &quality=0-100 — Changes the jpeg compression setting. 90 is the default value, and you really don't need to touch it. 90 produces fantastic quality and tiny files. New in v1.2
  • Secure - images still have to pass through ASP.NET's URL authorization system.
  • Can be used from ASP, PHP, HTML files, or any language that runs alongside ASP.NET. Images are separate requests, so you don't need to be using ASP.NET to make this work for you.
  • Not just for thumbnails - can resize images to any resolution. You can set the size limitations in web.config.
  • Great for slideshows - you can change the resolution of the images dynamically as the user resizes.
  • Supported input formats: BMP, GIF, JPG, PNG and TIFF
  • Supported output formats: JPG, PNG, GIF
  • Photoshop-quality bicubic resizing and jpeg compression.
  • Works with IIS5, IIS5.1, IIS6, IIS7, and ASP.NET 2.0+. v1.2 is optimized for IIS7 Integrated mode
  • Well documented, well organized code.
  • Great platform to build your own image processing systems on. You can use the disk caching system or image processing code separately.
  • You can set entire folders of images to resize using CustomFolders.cs. (v1.2) You can do "URL rewriting" on your images there also.

Bonus functionality

  • Example watermarking code. You can enable this feature by uncommenting the code.
  • yrl class for dealing with virtual paths.


  • Disk-based caching. Subsequent identical resizes are instantaneous.
    • Caching doesn't get in your way - if you modify the source file, the resized versions are also updated.
    • You can resize the same image to several different sizes, and the different versions are cached separately.
    • Managed disk cache. If the number of cached files exceeds the configured threshold, a cleanup pass is made on the directory, and a block of the least recently used files are removed.
  • Client-side caching directives are sent, minimizing repetitive requests from the same client.
  • Thumbnail generation in under 20 milliseconds for most images.
  • Suitable for slideshows and lists of images. Even the initial resizing of 50 images concurrently isn't noticeably slow.
  • Good with large source files (1-5MB)

Published on

About Nathanael

Nathanael Jones is a software engineer, father, consultant, and computer linguist with unreasonably high expectations of inanimate objects. He refines .NET, ruby, and javascript libraries full-time at Imazen, but can often be found on stack overflow or participating in W3C community groups.


If you develop websites, and those websites have images, ImageResizer can make your life much eaiser. Find out more at


I run Imazen, a tiny software company that specializes in web-based image processing and other difficult engineering problems. I spend most of my time writing image-processing code in C#, web apps in Ruby, and documentation in Markdown. Check out some of my current projects.

More articles