No description, website, or topics provided.
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.


Identify and protect images by adding a watermark to them.



Input Parameter Descriptions

Index Name Example Description
0 image_url string The URL to the source image
1 watermark_url string The URL to the watermark image
2 opacity integer The opacity of the watermark (0 to 100)
3 position string The position of the watermark image, possible values are: center, top-left, top-center, top-right, bottom-left, bottom-center, bottom-right
4 width integer If set resize the resulting image to this width (preserving aspect ratio)
5 height integer If set resize the resulting image to this height (preserving aspect ratio)

Making a Request

$ > require 'watermarker'
=> true

# Note: the 'Controller' here is not a reference to Rails controllers
# but an internal structure, won't interfere with your Rails app and will 
# work fine in a standalone ruby app or another framework

$ > wm =
=> #<Watermarker::APIController:0x007faba223c288>

data = wm.lookup("","","100","center","","")

# Writes the resized file data to the local directory
>>"base-with-watermark.png","w"){|f| f.write(data)}

Watermarked File Resized File

Base File Base File


# In your Gemfile
gem 'watermarker', git: ''

Live Interactive Testing

Doublecheck results, use a Live Proxy and check your API Key with the interactive documentation at:

You will need your WATERMARKER_API_KEY from the setup screen where you've provisioned the Watermarker add-on.


As a sanity check it is sometimes useful to bypass your app stack and check the endpoint, your API Key and parameters directly.

Test with your browser

# Modify the following to use your actual API Key

A successful call will return your requested data with a HTTP result code of 200 and be in JSON format. We recommend the JSON Formatter extension as a useful tool.

In Development

The Watermarker gem relies upon the environment variable ENV['WATERMARKER_API_KEY'] being present and correctly configured to authenticate to the service. You will need to have this variable present in your local environment for the gem to work correctly.

If you're using Heroku, please read their Guide to Heroku Local which has instructions on easily copying your config values to your development environment.


If you're trying to use Watermarker in your local development or test environment with the dotenv gem be sure that you are loading the dotenv-rails gem with the rails-now requirement.

# Example Gemfile excerpt

gem 'dotenv-rails', :require => 'dotenv/rails-now'
gem 'iptoearth'


If you're having issues with configuring dotenv, you might want to try foreman which will also autoload .env files in your local environment.

Test in the Rails console

Launch rails c in your development project directory and at the prompt enter ENV[WATERMARKER_API_KEY] which, if you've configured your development environment correctly should display your API Key.

Issues and Security Concerns

Please email


The Watermarker gem is licensed under the MIT license.

Additional Add-ons

If you found Watermarker useful, please check out our other similarly structured services and gems.

<td align='center' width='33%'>
   <img src="" width="70"/>
  <h5><a href='//'>WEIGHTS & MEASURES</a></h5>
  <p>Conversational interface to convert between units of measure.</p>

<td align='center' width='33%'>
   <img src="" width="70"/>
  <h5><a href='//'>SCRAPETASTIC</a></h5>
  <p>Pull structured data from any website.</p>
<td align='center' width='33%'>
   <img src="" width="70"/>
  <h5><a href='//'>IP INVESTIGATOR</a></h5>
  <p>Check if an IP address is hosting Proxies, Bots or Malware.</p>

<td align='center' width='33%'>
   <img src="" width="70"/>
  <h5><a href='//'>RESIZER</a></h5>
  <p>Resize images for Retina use, thumbnails and social promotion.</p>
<td align='center' width='33%'>
   <img src="" width="70"/>
  <h5><a href='//'>WEB TO PDF</a></h5>
  <p>Generate PDF Documents from Webpages.</p>

<td align='center' width='33%'>
   <img src="" width="70"/>
  <h5><a href='//'>WATERMARKER</a></h5>
  <p>Identify and protect images by adding a watermark to them.</p>
<td align='center' width='33%'>
   <img src="" width="70"/>
  <h5><a href='//'>GEOCODY</a></h5>
  <p>Convert mailing addresses into Lat,Long Coordinates.</p>

<td align='center' width='33%' cellpadding='10'>
   <img src="" width="70"/>
  <h5><a href='//'>REAL EMAIL</a></h5>
  <p>Reduce bounced emails and errors by validating emails against MX records.</p>

Generate QR codes for use anywhere.


Boost User Agent identification with our always up to date UA parsing.


Pull website status and domain information for any URL.


Find the Country and City of origin for an IP Address.