You could certainly do this in-process, either shelling out or by creating a gem that calls your C library. Additionally, if you're fronting your app with a server like nginx, you could use something akin to http://www.grid.net.ru/nginx/upload.en.html, so you wouldn't have to buffer the entire image into your Rails process.