/color
endpoint
Use the /color
endpoint to search your collection based on colors.
Specify one or more colors to retrieve images that match those colors, or have Flow extract the color palette from an input image to search with.
The examples below require the example dataset.
Find images with similar Hex color
Search by a blue color in format 0xRRGGBB
.
http://localhost:8983/api/cores/my-collection/color?
rank.by.hex=0x2E37B1
Search by multiple colors by adding comma separated 0xRRGGBB
values.
http://localhost:8983/api/cores/my-collection/color?
rank.by.hex=0xff0000,0x0000ff
Search by color palette
Use the extracted color palette of an image and search for images with a similar palette.
http://localhost:8983/api/cores/my-collection/color?
rank.by.id=1240
Filter by color name
The /color
endpoint requires rank.by.*
input. In the following examples, only filtering is used and therefore the generic endpoint /select
is used.
All images are automatically categorized by their color names.
To show images containing violet
color, just add a filter query fq
.
http://localhost:8983/api/cores/my-collection/select?fq=violet
Adaptive user interfaces
Flow automatically extracts the dominant color palette of each image and stores their hex values in the field color_palette_hex
.
These colors can be used create adaptive user interfaces.
Brand colors
Often user interfaces can be customized to fit the company's brand. Automatically set brand colors based on the extracted colors of an uploaded logo. Flow automatically detects and ignores backgrounds.
As you can see in the image above, Flow provides up to five colors and dynamically adjusts the number of colors to the image content.
Extract color palette from external images.
You don't have to index an image in order to retrieve its color palette. Instead, you just analyze the image using the /analyze
endpoint and extract the color_palette_hex
field from the output
object of the response.
Ambient coloring
Image-dependent ambient coloring creates a dynamic user interface to emphasize the impression of the images. Use the main color of an image to automatically color its surroundings in a user interface like in an image gallery, detail page of a product etc. This approach is particularly suited for music covers, artworks, and products.
To do so, request the color palette of the selected image with fl=color_palette_hex
.
The colors are sorted by frequency in descending order.
Retrieve the first value of color_palette_hex
to get the most important hex color of the image and use it for ambient coloring.