Skip to content

elgervb/imageproxy

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

71 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

imageproxy

Proxy for images

Usage

Upload your image and call it through the image proxy API:

Original without any filters
/imageproxy/img/original/<imagename.jpg>
http://elgervanboxtel.nl/imageproxy/img/original/dog.jpg

Original image

Apply filter with defaults
/imageproxy/img/<filtername>/<imagename.jpg>
http://elgervanboxtel.nl/imageproxy/img/pixelate/dog.jpg

Filtered image

Apply filter with parameters
/imageproxy/img/<filtername>/[<parameter=value>]/<imagename.jpg>
http://elgervanboxtel.nl/imageproxy/img/pixelate/rate=20/dog.jpg

Filtered image with parameters

Thumbnails

You can create thumbnails in several ways

centered

create a thumbnail which is centered in the middle of the image

Parameter Default Description
width 250 The new width of the image in pixels
height 250 The new height of the image in pixels

Examples
Centered Thumb Centered Thumb Centered Thumb

URL
/imageproxy/img/thumb/centered/width=150;height=350/dog.jpg
/imageproxy/img/thumb/centered/width=350;height=250/dog.jpg
/imageproxy/img/thumb/centered/width=150;height=150/dog.jpg

max

resize the image to a max width or height keeping proportions, thus restraining the image to a certain size

Parameter Default Description
width 250 The max width of the image in pixels
height 250 The max height of the image in pixels

Examples
Max Thumb Max Thumb Max Thumb

URL
/imageproxy/img/thumb/max/width=150;height=350/dog.jpg
/imageproxy/img/thumb/max/width=350;height=250/dog.jpg
/imageproxy/img/thumb/max/width=150;height=150/dog.jpg

percentage

reduce a image with a certain percentage

Parameter Default Description
percentage 250 The percentage to reduce the image with

Examples
Max Thumb Max Thumb Max Thumb

URL
/imageproxy/img/thumb/percentage/percentage=75/dog.jpg
/imageproxy/img/thumb/percentage/percentage=50/dog.jpg
/imageproxy/img/thumb/percentage/percentage=25/dog.jpg

square

Parameter Default Description
width 250 The new width of the image in pixels
height 250 The new height of the image in pixels

Examples
Centered Thumb Centered Thumb Centered Thumb

URL
/imageproxy/img/thumb/square/width=350/dog.jpg
/imageproxy/img/thumb/square/width=250/dog.jpg
/imageproxy/img/thumb/square/width=150/dog.jpg

Available Filters

blocks

Add random blocks to an image with custom size and color

Parameter Default Description
number 100 The number of blocks
size 25 The size of the blocks in pixels
color ffffff The color of the blocks

Examples
Blocks Filter Blocks Filter Blocks Filter

URL
/imageproxy/img/blocks/dog.jpg
/imageproxy/img/blocks/color=8D8942;size=10/dog.jpg
/imageproxy/img/blocks/color=000;size=60/dog.jpg

brightness

Adjust the brightness of the image, either lighter or darker

Parameter Default Description
rate 20 The brightness level from -255 to 255, from darker to lighter

Examples
Brightness Filter Brightness Filter Darker Brightness Filter Lighter

URL
/imageproxy/img/brightness/dog.jpg
/imageproxy/img/brightness/rate=-40/dog.jpg
/imageproxy/img/brightness/rate=100/dog.jpg

colorize

Blends a fill color with the image

Parameter Default Description
color ffffff The color to blend, either in hexadecimal or rgb(a)
opacity null The color opacity from 0 to 127

Examples
Colorize Filter Colorize Filter red Colorize Filter green

URL
/imageproxy/img/colorize/dog.jpg
/imageproxy/img/colorize/color=ff0000;opacity=100/dog.jpg
/imageproxy/img/colorize/colorcolor=rgba(0,255,0,40)/dog.jpg

comic

Apply a sketchy comic filter to an image

Parameter Default Description
opacity 40 The opacity from 0 to 127

Examples
Comic Filter Comic Filter Comic Filter

URL
/imageproxy/img/comic/dog.jpg
/imageproxy/img/comic/opacity=40/dog.jpg
/imageproxy/img/comic/opacity=100/dog.jpg

contrast

Changes the contrast of the image

Parameter Default Description
rate 5 The opacity from -100 to 100, from minimal contrast to high constrast

Examples
Contrast Filter Contrast Filter Contrast Filter

URL
/imageproxy/img/contrast/dog.jpg
/imageproxy/img/contrast/rate=40/dog.jpg
/imageproxy/img/contrast/rate=-10/dog.jpg

###darken Adjust the brightness of the image, either darker or lighter

Parameter Default Description
rate 20 The brightness level from -255 to 255, from lighter to darker

Examples
Darken Filter Darken Filter Lighter Darken Filter Darker

URL
/imageproxy/img/darken/dog.jpg
/imageproxy/img/darken/rate=-40/dog.jpg
/imageproxy/img/darken/rate=100/dog.jpg

###dodge Dodge an image, resulting in a darker image

Parameter Default Description
rate 75 The dodge level between 0 and 100

Examples
Dodge Filter Dodge Filter Lighter Dodge Filter Darker

URL
/imageproxy/img/dodge/dog.jpg
/imageproxy/img/dodge/rate=40/dog.jpg
/imageproxy/img/dodge/rate=10/dog.jpg

###duotone Duotone filter. Enhances Red, Green or Blue or a combination

Parameter Default Description
red 0 The amount of red to add max = 255
green 0 The amount of green to add max = 255
blue 0 The amount of blue to add max = 255

Examples
Dodge Filter Dodge Filter Lighter Dodge Filter Darker

URL
/imageproxy/img/duotone/dog.jpg
/imageproxy/img/duotone/red=40/dog.jpg
/imageproxy/img/duotone/green=10;blue=90/dog.jpg

###edgedetect Uses edge detection to highlight the edges in the image

Examples
Edge detect Filter

URL
/imageproxy/img/edgedetect/dog.jpg

###emboss Embosses the image

Examples
Edge detect Filter

URL
/imageproxy/img/emboss/dog.jpg

###findedges Find the edges in an image without color loss

Examples
Edge detect Filter

URL
/imageproxy/img/findedges/dog.jpg

###flip Flips an image

Parameter Default Description
mode both Direction to fip: vertical, horizontal or both

Examples
Flip Filter Flip Filter Vertical Flip Filter Horizontal

URL
/imageproxy/img/flip/dog.jpg
/imageproxy/img/flip/mode=vertical/dog.jpg
/imageproxy/img/flip/mode=horizontal/dog.jpg

###gammacorrection Applies gamma correction

Parameter Default Description
input 1.0 Input
output 1.537 Output

Examples
Gamma Correction Filter Gamma Correction Vertical FlipGamma Correction Horizontal

URL
/imageproxy/img/gammacorrection/dog.jpg
/imageproxy/img/gammacorrection/input=0.5;output=1/dog.jpg
/imageproxy/img/gammacorrection/input=2;output=1/dog.jpg

###gaussianblur Blurs the image using the Gaussian method.

Examples
Gaussian Blur Filter

URL
/imageproxy/img/gaussianblur/dog.jpg

###grayscale Converts the colors to grayscale

Examples
Gaussian Blur Filter

URL
/imageproxy/img/grayscale/dog.jpg

###huerotate Rotete the hue of the image

Parameter Default Description
rotate 90 degrees to rotate

Examples
Hue Rotate Filter Hue Rotate Filter Hue Rotate Filter

URL
/imageproxy/img/huerotate/dog.jpg
/imageproxy/img/huerotate/red=40/dog.jpg
/imageproxy/img/huerotate/green=10;blue=90/dog.jpg

###meanremove Uses mean removal to achieve a "sketchy" effect

Examples
Gaussian Blur Filter

URL
/imageproxy/img/meanremove/dog.jpg

###motionblur Motion blurs the image

Examples
Gaussian Blur Filter

URL
/imageproxy/img/motionblur/dog.jpg

###negative Create a negative of an image

Examples
Gaussian Blur Filter

URL
/imageproxy/img/negative/dog.jpg

###noise add noise to the image

Parameter Default Description
rate 20 The amount of noise to apply

Examples
Noise Filter Noise Filter Noise Filter

URL
/imageproxy/img/noise/dog.jpg
/imageproxy/img/noise/rate=40/dog.jpg
/imageproxy/img/noise/rate=80/dog.jpg

###oldcardboard Image filter to give the image an old cardboard look

Examples
Gaussian Blur Filter

URL
/imageproxy/img/oldcardboard/dog.jpg

###opacity Sets the opacity of an image

Parameter Default Description
opacity 80 A value between 0 and 127. 0 indicates completely opaque while 127 indicates completely transparent.

Examples
Opacity Filter Opacity Filter Opacity Filter

URL
/imageproxy/img/opacity/dog.jpg
/imageproxy/img/opacity/rate=40/dog.jpg
/imageproxy/img/opacity/rate=100/dog.jpg

###pixelate Pixelate an image

Parameter Default Description
rate 20 the blocksize in pixels

Examples
Pixelate Filter Pixelate Filter Pixelate Filter

URL
/imageproxy/img/pixelate/rate=5/dog.jpg
/imageproxy/img/pixelate/dog.jpg
/imageproxy/img/pixelate/rate=60/dog.jpg

###rotate Rotate an image over an angle

Parameter Default Description
degrees 90 The degrees to rotate the image
color null The background color to apply

Examples
Rotate Filter Rotate Filter Rotate Filter

URL
/imageproxy/img/rotate/dog.jpg
/imageproxy/img/rotate/degrees=180/dog.jpg
/imageproxy/img/rotate/degrees=45/dog.jpg

###scatter Scatter pixels around in a random way

Parameter Default Description
rate 5 the scatter size in pixels

Examples
Scatter Filter Scatter Filter Scatter Filter

URL
/imageproxy/img/scatter/dog.jpg
/imageproxy/img/scatter/rate=10/dog.jpg
/imageproxy/img/scatter/rate=10/dog.jpg

###selectiveblur Image filter Selective Blur

Examples
Selective blur Filter

URL
/imageproxy/img/selectiveblur/dog.jpg

###sepia Apply sepia to the image

Parameter Default Description
rate 15 the darken rate

Examples
Sepia Filter Sepia Filter Sepia Filter

URL
/imageproxy/img/sepia/dog.jpg
/imageproxy/img/sepia/rate=30/dog.jpg
/imageproxy/img/sepia/rate=60/dog.jpg

###semigrayscale Applies grayscale to an image, optionally add a grayscale percentage

Parameter Default Description
rate 75 The grayscale rate

Examples
Sepia Filter Sepia Filter Sepia Filter

URL
/imageproxy/img/semigrayscale/dog.jpg
/imageproxy/img/semigrayscale/rate=30/dog.jpg
/imageproxy/img/semigrayscale/rate=60/dog.jpg

###sepiafast Apply sepia to the image (fast)

Examples
Sepia fast Filter Sepia fast Filter Sepia fast Filter

URL
/imageproxy/img/sepiafast/dog.jpg

###sharpen Sharpens the image

Examples
Sepia fast Filter

URL
/imageproxy/img/sharpen/dog.jpg

###smooth Makes the image smoother.

Parameter Default Description
rate 5 the darken rate

Examples
Smooth Filter Smooth Filter Smooth Filter

URL
/imageproxy/img/sepia/dog.jpg
/imageproxy/img/sepia/rate=15/dog.jpg
/imageproxy/img/sepia/rate=30/dog.jpg

###sobel Sobel edge detect (extremely slow...)

Examples
Sobel Edge Detect Filter

URL
/imageproxy/img/sobel/dog.jpg

###sobeledge Sobel edge enhance

Examples
Sobel Edge Detect Filter

URL
/imageproxy/img/sobeledge/dog.jpg

###truecolor Makes the image smoother.

Parameter Default Description
primary ffffff the primary color
secundary 000000 the secundary color

Examples
Smooth Filter Smooth Filter Smooth Filter

URL
/imageproxy/img/truecolor/dog.jpg
/imageproxy/img/truecolor/primary=B7121D;secundary=5774DB/dog.jpg
/imageproxy/img/truecolor/primary=C1C1C1;secundary=44C4BD/dog.jpg

###vignette Applies a darker mask around the edges of the image

Examples
Smooth Filter

URL
/imageproxy/img/vignette/dog.jpg