How can I request an image and return it as black and white in rails?

Posted by NotDan on Stack Overflow See other posts from Stack Overflow or by NotDan
Published on 2010-03-28T22:55:05Z Indexed on 2010/03/28 23:33 UTC
Read the original article Hit count: 274

Filed under:

I'd like to have an image and a combo box with 2 options: color, and black and white. When the combo box selection changes, I'd like to return the image as black and white and have this done dynamically on the server (so I don't have to store the black and white image on the server).

I was thinking I could point the img tag at a url like "/images/blackandwhite/120" where 120 is the image id of the color picture, and have it dynamically turn the image to black and white and return the image data to the browser.

Is this possible? How would I do this?

© Stack Overflow or respective owner

Related posts about ruby-on-rails