django-watermark icondjango-watermark 0.1.6 Pre 1

Quick and efficient way to apply watermarks to images in Django.
django-watermark provides a simple way for you to apply custom watermarks to images on your Django-powered website.

Usage:

As mentioned above, you have several options when using django-watermark. The first thing you must do is load the filter for the template in which you wish to apply watermarks to your images.

{% load watermark %}

From the Django admin, go ahead and populate your database with some watermarks that you want to apply to your regular images. Simply specify a name for the watermark and upload the watermark image itself. It's probably not a good idea to put commas in your watermark names. Watermarks should be transparent PNG files for best results. I can't make any guarantees that other formats will work nicely.

The first parameter to the watermark filter must be the name you specified for the watermark in the Django admin. You can then choose from a few other parameters to customize the application of the watermark. Here they are:

position

This one is quite customizable. First, you can plug your watermark into one corner of your images by using one of br, bl, tr, and tl. These represent 'bottom-right', 'bottom-left', 'top-right', and 'top-left' respectively.

Alternatively, you can use relative or absolute positioning for the watermark. Relative positioning uses percentages; absolute positioning uses exact pixels. You can mix and match these two modes of positioning, but you cannot mix and match relative/absolute with the corner positioning. When using relative/absolute positioning, the value for the position parameter is XxY, where X is the left value and Y is the top value. The left and top values must be separated with a lowercase x.

If you wanted the top-left corner of your watermark image to show up in the center of any image you want to watermark, you would use a position parameter such as position=50%x50%. If you wanted the watermark to show up half-way between the left and right edges of the image and 100 pixels from the top, you would use a position parameter such as position=50%x100.

opacity

This parameter allows you to specify the transparency of the applied watermark. The value must be an integer between 0 and 100, where 0 is fully transparent and 100 is fully opaque. By default, the opacity is set at 50%.

tile

If you want your watermark to tile across the entire image, you simply specify a parameter such as tile=1. This parameter takes precedence over the position but not the scale parameter. That means that if you specify position and tile=1, the position parameter will be ignored. However, if you specify tile=1 and scale=1, the tile parameter will be ignored.

scale

If you'd like to have the watermark as big as possible on the target image and fully visible, you might want to use scale=1. This parameter takes precendece over both the tile and position parameter. That means that if you specify either of those parameters (position and tile) along with the scale=1 parameter, only scale will be applied.

Main features:

  • Opacity: the filter allows you to specify the transparency level for your watermark image.
  • Watermark positioning: you have several options for positioning watermarks on your images.
  • Absolute: you can specify exact pixel locations for your watermark
  • Relative: you can use percentages to place your watermark
  • Corners: you can position your watermark in the corners of your images
  • Scaling: the watermark can be scaled to cover your images
  • Tiling: the watermark can be tiled across your images

last updated on:
January 3rd, 2011, 2:07 GMT
price:
FREE!
developed by:
Josh VanderLinden
license type:
BSD License 
category:
ROOT \ Internet \ HTTP (WWW)

FREE!

In a hurry? Add it to your Download Basket!

user rating

UNRATED
0.0/5
 

0/5

Add your review!

SUBMIT