Subimage
FINDING A SUBIMAGE
Blitline can try to find an image within another image. You can use the pre-process functionality to determine if a subimage exists within another image.
Currently we only support a ‘first found’ functionality, and can return the x,y co-ordinates of the found image.
{
"src_type": "pre_process_only",
"application_id": "YOUR_APP_UID",
"src": "http://cdn.blitline.com/filters/boys.jpeg",
"v": 1.22,
"pre_process": [
{
"find_subimage": {
"subimage_src": "https://s3.amazonaws.com/blitdoc/pngs/boys_subimage.jpg"
}
}
]
}
This will postback the following JSON:
[
{
"action_result": {
"is_found": true,
"found_location": {
"x": 100,
"y": 100,
"accuracy": 0.0258131
}
}
}
]
Where there will always be an “is_found” boolean result, and if “true”, there will be a “found_location” with x,y co-ordinates.
SEAM CARVING/LIQUID RESCALE
Seam carving (also known as image retargeting, content-aware image resizing, content-aware scaling, liquid resizing, or liquid rescaling).
The purpose of the algorithm is to display images without distortion on various media (cell phones, etc) using document standards, like HTML, that already support dynamic changes in page layout and text, but not images. (via Wikipedia)
In more common terms, it allows an image to be reduced in size by removing similar content contained within the image. Unlike scaling which will distort or cut off edges of the image, liquid rescaling analyzes the image, and reduces it size based on repeating patterns in the image. In the example below, you will see that the repeating water content is cropped out, while still leaving the interesting edge parts of the image.
ORIGINAL (800X122)
LIQUID RESCALED (600X122)
Compare this with your other standard options
Resize to fit (600px92 wide)
- NOTICE HEIGHT NOW HAS TO BE REDUCED TO ACCOUNT FOR THE HORIZONTAL SHORTENING
Resize to fill (600x122)
- NOTICE THE EDGES OF THE IMAGE ARE TRUNCATED
How do I use it?
Just use the “liquid_rescale function”
{
"application_id": "YOUR_APP_ID",
"src": "https://s3.amazonaws.com/img.blitline/web/wide_trimmed.jpg",
"functions": [
{
"name": "liquid_rescale",
"params": {
"width": 600
},
"save": {
"image_identifier": "MY_CLIENT_ID"
}
}
]
}