Pattern Tap 2.0 RSS

Image Manipulation w/ Ruby

For the next version of PT, we’ll most likely be needing different thumbnail sizes to reflect the needs of the design. The current PT is written in PHP, but PT is going to be written in Ruby going forward (alpha.patterntap.com is already written in Rails), so I decided to take a gander as what’s out their for image manipulation in Ruby.

For raw image manipulation, there is RMagick, ImageScience and MiniMagick. I may end up using one of those directly, but most likely I’ll be using a higher-level library that provides more functionality (storage to S3, accepting uploads, etc) in addition to just image manipulation. For these types of libraries, there is Paperclip (most people’s go-to), CarrierWave, and Dragonfly (awesome on-the-fly capabilities). All of those libraries have their pros/cons, but I decided to play around with CarrierWave a bit since I haven’t used it before.

Outside of handling uploads and storage, CarrierWave does have some nice wrappers around ImageMagick functions that I wanted to play around with.

I used this script to play around with CarrierWave.

Here are some before and after shots of a couple of images using resize_to_fill.

Before:

After:

Before:

After:

2 notes
Skip to comments
  1. patterntapdev posted this
blog comments powered by Disqus

Matthew Smith

Portrait photo for Kevin Smith

An experienced Creative Director and designer for top companies, Matthew also speaks and writes for the web design community. When he's not designing, you'll find him building treehouses for his two young boys or sipping on a fine Belgian Tripel with his wife Amy.

Jamin Jantz

Portrait photo for Jamin Jantz

Give him a brilliant idea for a business and Jamin will help you build it. Jamin lives both in the creative and business worlds — both geeking out over a a beautiful UI and a smart spreadsheet. After work (whenever that is), Jamin tends his organic garden and hangs out with his family.

Martin Parets

Portrait photo for Martin Parets

A proficient front-end developer who fell in love with the Internet from an early age, Martin still remembers his first Geocities site address (/Rainforest/Canopy/9907 if you must know). Outside of computing he has a fond love for traveling, board games, and Swedish death metal.

Tim Dorr

Portrait photo for Tim Dorr

Tim is busy. Really busy. You'll find him running Army of Bees (developers of PT 2.0), building his new startup Billfold, mentoring startups in Atlanta, running a coworking space, starting a dance club, taking photographs, and on occasion sleeping.