Live Examples
These are some example you can run yourself on Blitline.com
- Simple Thumbnail Example: This is the canonical use of Blitline. Taking an online image and thumbnailing to a smaller size.
- File Extension Override:If you are unhappy with the default .jpg extension (or .png) that Blitline defaults to, you can explicitly set what the outputted filename is.
- Smart Image: Blitline will try to determine filetype based on source and generate an image for you automatically based on reasonable defaults.
- PNG32 to PNG8: If you are saving out PNG files, you can convert them from 32bit to 8bit, preserving the transparency and reducing the file size DRAMATICALLY. In this example, file size is cut by 50% without a noticeable drop in quality
- Performing Multiple Scale Functions on Single Source: It’s possible to perform multiple operations on the same source. In this example we start with a PDF and we scale it to 3 different sizes.
- Run ImageMagick™ scripts: You can run your own IM scripts on Blitline! Check it out here!
- Force image to sRGB: Useful for forcing all your images to a standard sRGB colorspace
- Extract video thumbs: Extract thumbnails from videos. Pages array indicates seconds from start
- Resize with percentage: This uses a scale_factor on the resize function
- Using the permissions you’ve given Blitline for sources: By default, Blitline assumes a source is public. If you instead want to have Blitline read OUT of your private bucket, you will need to change how the “src” is described. This is an example of using an “s3” source bucket and key
- Taking a screenshot of a website: Using our Blitshot functionality, you can take a live screenshot of any url.
- Using screenshot of Text+CSS composited onto image: Using our Blitshot functionality, you can take a screenshot of some html text rendered on a transparent background then overlay it on to an image for professional looking images.
- Circle crop and image (with a mask): Use a bitmap mask to crop and image to be a circle. This can be done with any mask, please see a better discussion on our blog.
- Canvas and composite: Starts with a raw canvas and composites a png on top.
- Inline image(Base64 encoding) You can use an inline “src” (like you find often in html tags
- Pad, Font, and Kerning: Add a solid bar at the bottom of an image, then add custom text with font and kerning to the newly added bar.
- Transparent overlay, text, and text dropshadow: Overlays a transparent section at the bottom of a page, then composite text with dropshadows and images.
- Lines and a Watermark: Add lines and a watermark to an image.
- Convert DICOM to png: You can even convert other formats to easy to handle png or jpeg files, such as medical DICOM files (Note: File must have extension .dcm)
- Convert CALS to jpg: You can even convert other formats to easy to handle png or jpeg files, such as CALS files (Note: File must have extension .cals)
- Extract Colors: Extract color information from an image
- SVG Rasterizer: We can convert your SVG files into raster images (png, jpeg, etc). We use Apache Batik™ for rasterization.
- Rasterize Adobe Illustrator™ AI file: We can convert your .ai files into raster images (png, jpeg, etc).
- Rasterize EPS files: We can convert your .eps files into raster images (png, jpeg, etc).
- Push multiple images into a zip file: If you have a group of images, you can use Blitline to create a zip out of them.
- Make images same size when compositing: Sometimes you need to scale a composited image to match a src image, you can have Blitline automatically scale the composite image.
- Composite an image UNDER another image: This example shows compositing one image on top of another image (A over B) and also how to composite under another image (A under B)
- Imagga (Smart) Tags: This example shows chooses a random image and runs the Imagga Tag analyzer on it. The results will show what the Imagga Tag analyzer thinks proper tags are for the image.
- Set background opposite of foreground When handling tranparent pngs, the default background is white, but if the PNG is white, you want the background to be dark instead.
- Apache Tika Example Get back textual data out of documents.
- AWS Reckognition (Detect Labels) Use AWS Reckognition to determine contents of an image.
Kitchen Sink Example
The following is the stereotypical job JSON for handling images uploaded via web from clients where you do no control filetypes (such as photos from phones and cameras).
{
"application_id": "YOUR_APP_ID",
"src": "http://cdn.blitline.com/filters/boys.jpeg",
"src_data" : { "colorspace" : "srgb"},
"postback_url" : "http://YOUR_POSTBACK_URL",
"wait_retry_delay": 5,
"src_type" : "smart_image",
"retry_postback" : true,
"get_exif" : true,
"v" : 1.20,
"functions": [
{
"name": "resize_to_fit",
"params": {
"width": 100,
"autosharpen": true
},
"save": {
"image_identifier": "MY_CLIENT_ID"
}
}
]
}
Updated 10 months ago
Did this page help you?