This API resizes, converts, filters, and superimposes all kinds of images.
We just need to know:
- Where the original image is (the url)
- What special processing you want to do? (ie. convert, resize, etc)
For example, you make a web request with a special URL:
http://mtmimages.com/v1?src=http://mysite.com/photo.jpg&w=200&h=200
Our response will be the processed image. So in this case, we'll download
your image from http://mysite.com/photo.jpg, resize it to 200x200 pixels, and
send it on back.
HTML
The great thing is, this works really well in HTML. Just drop a special URL
in your img tag and get a properly resized image shown right on your page:
<img src="http://mtmimages.com/v1?src=http://mysite.com/photo.jpg&w=200&h=200" />
Or maybe you want to screenshot a website, show it on an iPhone, resized to
100x200, on a red background, as a JPEG. No problem:
<img src="http://mtmimages.com/v1?ss=http://google.com&w=200&h=200&d=iphone&bg=red&ext=jpg" />
Server Side (Ruby)
Showing images on webpages is just the beginning. You might want to save the new image
to your web server:
require 'open-uri'
open('/tmp/photo_resized.jpg', 'wb') do |file|
f << open('http://mtmimages.com/v1?src=mysite.com/photo.jpg&w=200&h=200').read
end
Like the concept but not sure how to use it? Perfect, check out our
Getting Started page.