SlideShare a Scribd company logo
Searching Images by Color 
Chris Becker 
Search Engineering @ Shutterstock
What is Shutterstock?! 
• Shutterstock sells stock images, videos & music.! 
• Crowdsourced from artists around the world! 
• Shutterstock reviews and indexes them for search! 
• Customers by a subscription and download them!
Why search by color?!
Stock photography on the internet…!
Stock photography on the internet…!
Color is one of several visual 
attributes that you can use ! 
to create an engaging ! 
image search experience!
Shutterstock Labs! 
www.shutterstock.com/labs! 
! 
Spectrum! 
Palette!
Diving into Color Data!
Color Spaces! 
• RGB! 
! 
• HSL! 
! 
• LCH! 
! 
• Lab!
Calculating Distances Between Colors! 
• Euclidean distance works reasonably well in any color 
space! 
! 
distRGB = sqrt((r1-r2)^2 + (g1-g2)^2 + (b1-b2)^2)! 
distHSL = sqrt((h1-h2)^2 + (s1-s2)^2 + (l1-l2)^2)! 
distLCH = sqrt((L1-L2)^2 + (C1-C2)^2 + (H1-H2)^2)! 
! 
• More sophisticated equations that better account for 
human perception can be found at! 
http://en.wikipedia.org/wiki/Color_difference! 
!
Images are just numbers! 
[ 
[[054,087,058], [054,116,206], [017,226,194], [234,203,215], [188,205,000], [229,156,182]], 
[[214,238,109], [064,190,104], [191,024,161], [104,071,036], [222,081,005], [204,012,113]], 
[[197,100,189], [159,204,024], [228,214,054], [250,098,125], [050,144,093], [021,122,101]], 
[[255,146,010], [115,156,002], [174,023,137], [161,141,077], [154,189,005], [242,170,074]], 
[[113,146,064], [196,057,200], [123,203,160], [066,090,234], [200,186,103], [099,074,037]], 
[[194,022,018], [226,045,008], [123,023,087], [171,029,021], [040,001,143], [255,083,194]], 
[[115,186,246], [025,064,109], [029,071,001], [140,031,002], [248,170,244], [134,112,252]], 
[[116,179,059], [217,205,159], [157,060,251], [151,205,058], [036,214,075], [107,103,130]], 
[[052,003,227], [184,037,078], [161,155,181], [051,070,186], [082,235,108], [129,233,211]], 
[[047,212,209], [250,236,085], [038,128,148], [115,171,113], [186,092,227], [198,130,024]], 
[[225,210,064], [123,049,199], [173,207,164], [161,069,220], [002,228,184], [170,248,075]], 
[[234,157,201], [168,027,113], [117,080,236], [168,131,247], [028,177,060], [187,147,084]], 
[[184,166,096], [107,117,037], [154,208,093], [237,090,188], [007,076,086], [224,239,210]], 
[[105,230,058], [002,122,240], [036,151,107], [101,023,149], [048,010,225], [109,102,195]], 
[[050,019,169], [219,235,027], [061,064,133], [218,221,113], [009,032,125], [109,151,137]], 
[[010,037,189], [216,010,101], [000,037,084], [166,225,127], [203,067,214], [110,020,245]], 
[[180,147,130], [045,251,177], [127,175,215], [237,161,084], [208,027,218], [244,194,034]], 
[[089,235,226], [106,219,220], [010,040,006], [094,138,058], [148,081,166], [249,216,177]], 
[[121,110,034], [007,232,255], [214,052,035], [086,100,020], [191,064,105], [129,254,207]], 
]
Any operation you can do on a set of 
numbers, you can do on an image! 
• getting histograms! 
• computing median values! 
• standard deviations / variance! 
• other statistics !
Extracting Color Data!
Tools & Libraries! 
• ImageMagick! 
• Python Image Library! 
• ImageJ!
Code Example! 
#! /usr/bin/env perl! 
use Image::Magick;! 
! 
my $image = Image::Magick->new;! 
$image->Read(‘SamplePhoto.jpg’);! 
$image->Quantize(colorspace => 'RGB', colors => 64);! 
my @histogram = $image->Histogram();! 
my %colors;! 
! 
while ( my($R,$G,$B,$opacity,$count) = splice(@histogram,0,5)) {! 
! 
# convert r,g,b to a hex color value! 
my $hex = sprintf("%02x%02x%02x",! 
$R / 256,! 
$G / 256,! 
$B / 256! 
);! 
! 
$colors{$hex} += $count; ! 
}!
Indexing & Searching 
in Solr!
Indexing color histograms! 
• index colors just like you would index text! 
• volume of color == frequency of the term! 
color_txt = "cfebc2 
cfebc2 cfebc2 cfebc2 
cfebc2 2e6b2e 2e6b2e 
2e6b2e ff0000 …"
Solr Fields & Queries! 
<field name="color" type="text_ws" …>! 
• Easy to query! 
• Can use solr’s default ranking effectively! 
! 
/solr/select?q=ff0000 e2c2d2&qf=color&defType=edismax…! 
! 
• or access term frequencies directly to create specific sort 
functions:! 
! 
sort=product(tf(color,"ff0000"),tf(color,"e2c2d2")) desc!
Indexing color statistics! 
Represent aggregate statistics of each image! 
lightness: 
median: 2 
standard dev: 1 
largest bin: 0 
largest bin size: 50 
saturation 
median: 0 
standard dev: 0 
largest bin: 0 
largest bin size: 100 
…
Solr Fields & Queries! 
<field name=”hue_median” type=”int” …>! 
• Sort by the distance between input param and median value! 
! 
/solr/select?q=*&sort=abs(sub($query,hue_median)) asc!
Ranking & Relevance!
How much of the image has the color ? !
is this relevant if I search for ?!
which image is more relevant if I search for ?!
is this relevant if I search for ?!
How do we account for these factors?!
How much of the image contains the 
selected color?! 
• Score each color by number/percentage of pixels! 
! 
sort=tf(color,"ff9900") desc!
Color Accuracy! 
• As you reduce your color space, you also reduce 
precision! 
• reducing the colorspace too much increases recall and lowers precision. ! 
• Not reducing it enough lowers recall and higher precision.! 
• reducing your color space down to ~100 to ~300 colors works well!
Weighing Multiple Colors Equally! 
• If you search for 2 or more colors, the top result should 
have the most even distribution of those colors! 
• simple option:! 
! 
sort=product(tf(color,"ff9900"),tf(color,"2280e2")) desc! 
! 
• more complex: compute the stdev or variance of the 
matching color values in your solr sort function, and sort the 
results with the lowest variance first. ! 
!
Accounting for Similar & Different 
Colors! 
• The score for a particular color should reflect all the colors in the image.! 
• At indexing time, increase the score based on similar colors; decrease it 
based on differing colors.!
Conclusion!
Conclusion! 
• This talk provided a rough guide to building a basic search-by-color 
application! 
• Lots of opportunity to do more sophisticated things in image search. ! 
• matching colors in certain parts of an image! 
• identifying visual styles (blur vs sharp, high contrast, etc)! 
• patterns & textures! 
• analyzing content in images (object detection)! 
! 
!
One more demo…!

More Related Content

Similar to Searching Images by Color: Presented by Chris Becker, Shutterstock

Digitization Basics for Archives and Special Collections – Part 1: Select and...
Digitization Basics for Archives and Special Collections – Part 1: Select and...Digitization Basics for Archives and Special Collections – Part 1: Select and...
Digitization Basics for Archives and Special Collections – Part 1: Select and...
WiLS
 
Helvetia
HelvetiaHelvetia
Helvetia
ESUG
 
Efficient realization for geometric transformation of digital images in run l...
Efficient realization for geometric transformation of digital images in run l...Efficient realization for geometric transformation of digital images in run l...
Efficient realization for geometric transformation of digital images in run l...
Shlomo Pongratz
 
F# at GameSys
F# at GameSysF# at GameSys
F# at GameSysYan Cui
 
Agile estimation 2_complete
Agile estimation 2_completeAgile estimation 2_complete
Agile estimation 2_completexpdaysgermany
 
Introduction to Coding
Introduction to CodingIntroduction to Coding
Introduction to Coding
Fabio506452
 
Beginning android games
Beginning android gamesBeginning android games
Beginning android games
Mario Zechner
 
Style Guide
Style GuideStyle Guide
Style Guide
JP Stones
 
Postgres is easier
Postgres is easierPostgres is easier
Postgres is easier
gisborne
 
Compass, Sass, and the Enlightened CSS Developer
Compass, Sass, and the Enlightened CSS DeveloperCompass, Sass, and the Enlightened CSS Developer
Compass, Sass, and the Enlightened CSS Developer
Wynn Netherland
 
Learn Creative Coding: Begin Programming with the Processing Language
Learn Creative Coding: Begin Programming with the Processing LanguageLearn Creative Coding: Begin Programming with the Processing Language
Learn Creative Coding: Begin Programming with the Processing Language
shelfrog
 
Learn Creative Coding: Begin Programming with the Processing Language
Learn Creative Coding: Begin Programming with the Processing LanguageLearn Creative Coding: Begin Programming with the Processing Language
Learn Creative Coding: Begin Programming with the Processing Language
W M Harris
 
Doing More With Less
Doing More With LessDoing More With Less
Doing More With Less
David Engel
 
XNA L10–Shaders Part 1
XNA L10–Shaders Part 1XNA L10–Shaders Part 1
XNA L10–Shaders Part 1Mohammad Shaker
 
PHP Barcelona Monthly Talk Feb 2015
PHP Barcelona Monthly Talk Feb 2015PHP Barcelona Monthly Talk Feb 2015
PHP Barcelona Monthly Talk Feb 2015
Sergi González Pérez
 
R workshop iii -- 3 hours to learn ggplot2 series
R workshop iii -- 3 hours to learn ggplot2 seriesR workshop iii -- 3 hours to learn ggplot2 series
R workshop iii -- 3 hours to learn ggplot2 series
Vivian S. Zhang
 
Building a World-Class Quality Team at eBay
Building a World-Class Quality Team at eBayBuilding a World-Class Quality Team at eBay
Building a World-Class Quality Team at eBay
TechWell
 

Similar to Searching Images by Color: Presented by Chris Becker, Shutterstock (20)

Digitization Basics for Archives and Special Collections – Part 1: Select and...
Digitization Basics for Archives and Special Collections – Part 1: Select and...Digitization Basics for Archives and Special Collections – Part 1: Select and...
Digitization Basics for Archives and Special Collections – Part 1: Select and...
 
Helvetia
HelvetiaHelvetia
Helvetia
 
Efficient realization for geometric transformation of digital images in run l...
Efficient realization for geometric transformation of digital images in run l...Efficient realization for geometric transformation of digital images in run l...
Efficient realization for geometric transformation of digital images in run l...
 
F# at GameSys
F# at GameSysF# at GameSys
F# at GameSys
 
Agile estimation 2_complete
Agile estimation 2_completeAgile estimation 2_complete
Agile estimation 2_complete
 
Introduction to Coding
Introduction to CodingIntroduction to Coding
Introduction to Coding
 
Beginning android games
Beginning android gamesBeginning android games
Beginning android games
 
Style Guide
Style GuideStyle Guide
Style Guide
 
Postgres is easier
Postgres is easierPostgres is easier
Postgres is easier
 
Compass, Sass, and the Enlightened CSS Developer
Compass, Sass, and the Enlightened CSS DeveloperCompass, Sass, and the Enlightened CSS Developer
Compass, Sass, and the Enlightened CSS Developer
 
SQL
SQLSQL
SQL
 
Html 1
Html 1Html 1
Html 1
 
Learn Creative Coding: Begin Programming with the Processing Language
Learn Creative Coding: Begin Programming with the Processing LanguageLearn Creative Coding: Begin Programming with the Processing Language
Learn Creative Coding: Begin Programming with the Processing Language
 
Learn Creative Coding: Begin Programming with the Processing Language
Learn Creative Coding: Begin Programming with the Processing LanguageLearn Creative Coding: Begin Programming with the Processing Language
Learn Creative Coding: Begin Programming with the Processing Language
 
Doing More With Less
Doing More With LessDoing More With Less
Doing More With Less
 
XNA L10–Shaders Part 1
XNA L10–Shaders Part 1XNA L10–Shaders Part 1
XNA L10–Shaders Part 1
 
PHP Barcelona Monthly Talk Feb 2015
PHP Barcelona Monthly Talk Feb 2015PHP Barcelona Monthly Talk Feb 2015
PHP Barcelona Monthly Talk Feb 2015
 
R workshop iii -- 3 hours to learn ggplot2 series
R workshop iii -- 3 hours to learn ggplot2 seriesR workshop iii -- 3 hours to learn ggplot2 series
R workshop iii -- 3 hours to learn ggplot2 series
 
Building a World-Class Quality Team at eBay
Building a World-Class Quality Team at eBayBuilding a World-Class Quality Team at eBay
Building a World-Class Quality Team at eBay
 
CSS
CSSCSS
CSS
 

More from Lucidworks

Search is the Tip of the Spear for Your B2B eCommerce Strategy
Search is the Tip of the Spear for Your B2B eCommerce StrategySearch is the Tip of the Spear for Your B2B eCommerce Strategy
Search is the Tip of the Spear for Your B2B eCommerce Strategy
Lucidworks
 
Drive Agent Effectiveness in Salesforce
Drive Agent Effectiveness in SalesforceDrive Agent Effectiveness in Salesforce
Drive Agent Effectiveness in Salesforce
Lucidworks
 
How Crate & Barrel Connects Shoppers with Relevant Products
How Crate & Barrel Connects Shoppers with Relevant ProductsHow Crate & Barrel Connects Shoppers with Relevant Products
How Crate & Barrel Connects Shoppers with Relevant Products
Lucidworks
 
Lucidworks & IMRG Webinar – Best-In-Class Retail Product Discovery
Lucidworks & IMRG Webinar – Best-In-Class Retail Product DiscoveryLucidworks & IMRG Webinar – Best-In-Class Retail Product Discovery
Lucidworks & IMRG Webinar – Best-In-Class Retail Product Discovery
Lucidworks
 
Connected Experiences Are Personalized Experiences
Connected Experiences Are Personalized ExperiencesConnected Experiences Are Personalized Experiences
Connected Experiences Are Personalized Experiences
Lucidworks
 
Intelligent Insight Driven Policing with MC+A, Toronto Police Service and Luc...
Intelligent Insight Driven Policing with MC+A, Toronto Police Service and Luc...Intelligent Insight Driven Policing with MC+A, Toronto Police Service and Luc...
Intelligent Insight Driven Policing with MC+A, Toronto Police Service and Luc...
Lucidworks
 
[Webinar] Intelligent Policing. Leveraging Data to more effectively Serve Com...
[Webinar] Intelligent Policing. Leveraging Data to more effectively Serve Com...[Webinar] Intelligent Policing. Leveraging Data to more effectively Serve Com...
[Webinar] Intelligent Policing. Leveraging Data to more effectively Serve Com...
Lucidworks
 
Preparing for Peak in Ecommerce | eTail Asia 2020
Preparing for Peak in Ecommerce | eTail Asia 2020Preparing for Peak in Ecommerce | eTail Asia 2020
Preparing for Peak in Ecommerce | eTail Asia 2020
Lucidworks
 
Accelerate The Path To Purchase With Product Discovery at Retail Innovation C...
Accelerate The Path To Purchase With Product Discovery at Retail Innovation C...Accelerate The Path To Purchase With Product Discovery at Retail Innovation C...
Accelerate The Path To Purchase With Product Discovery at Retail Innovation C...
Lucidworks
 
AI-Powered Linguistics and Search with Fusion and Rosette
AI-Powered Linguistics and Search with Fusion and RosetteAI-Powered Linguistics and Search with Fusion and Rosette
AI-Powered Linguistics and Search with Fusion and Rosette
Lucidworks
 
The Service Industry After COVID-19: The Soul of Service in a Virtual Moment
The Service Industry After COVID-19: The Soul of Service in a Virtual MomentThe Service Industry After COVID-19: The Soul of Service in a Virtual Moment
The Service Industry After COVID-19: The Soul of Service in a Virtual Moment
Lucidworks
 
Webinar: Smart answers for employee and customer support after covid 19 - Europe
Webinar: Smart answers for employee and customer support after covid 19 - EuropeWebinar: Smart answers for employee and customer support after covid 19 - Europe
Webinar: Smart answers for employee and customer support after covid 19 - Europe
Lucidworks
 
Smart Answers for Employee and Customer Support After COVID-19
Smart Answers for Employee and Customer Support After COVID-19Smart Answers for Employee and Customer Support After COVID-19
Smart Answers for Employee and Customer Support After COVID-19
Lucidworks
 
Applying AI & Search in Europe - featuring 451 Research
Applying AI & Search in Europe - featuring 451 ResearchApplying AI & Search in Europe - featuring 451 Research
Applying AI & Search in Europe - featuring 451 Research
Lucidworks
 
Webinar: Accelerate Data Science with Fusion 5.1
Webinar: Accelerate Data Science with Fusion 5.1Webinar: Accelerate Data Science with Fusion 5.1
Webinar: Accelerate Data Science with Fusion 5.1
Lucidworks
 
Webinar: 5 Must-Have Items You Need for Your 2020 Ecommerce Strategy
Webinar: 5 Must-Have Items You Need for Your 2020 Ecommerce StrategyWebinar: 5 Must-Have Items You Need for Your 2020 Ecommerce Strategy
Webinar: 5 Must-Have Items You Need for Your 2020 Ecommerce Strategy
Lucidworks
 
Where Search Meets Science and Style Meets Savings: Nordstrom Rack's Journey ...
Where Search Meets Science and Style Meets Savings: Nordstrom Rack's Journey ...Where Search Meets Science and Style Meets Savings: Nordstrom Rack's Journey ...
Where Search Meets Science and Style Meets Savings: Nordstrom Rack's Journey ...
Lucidworks
 
Apply Knowledge Graphs and Search for Real-World Decision Intelligence
Apply Knowledge Graphs and Search for Real-World Decision IntelligenceApply Knowledge Graphs and Search for Real-World Decision Intelligence
Apply Knowledge Graphs and Search for Real-World Decision Intelligence
Lucidworks
 
Webinar: Building a Business Case for Enterprise Search
Webinar: Building a Business Case for Enterprise SearchWebinar: Building a Business Case for Enterprise Search
Webinar: Building a Business Case for Enterprise Search
Lucidworks
 
Why Insight Engines Matter in 2020 and Beyond
Why Insight Engines Matter in 2020 and BeyondWhy Insight Engines Matter in 2020 and Beyond
Why Insight Engines Matter in 2020 and Beyond
Lucidworks
 

More from Lucidworks (20)

Search is the Tip of the Spear for Your B2B eCommerce Strategy
Search is the Tip of the Spear for Your B2B eCommerce StrategySearch is the Tip of the Spear for Your B2B eCommerce Strategy
Search is the Tip of the Spear for Your B2B eCommerce Strategy
 
Drive Agent Effectiveness in Salesforce
Drive Agent Effectiveness in SalesforceDrive Agent Effectiveness in Salesforce
Drive Agent Effectiveness in Salesforce
 
How Crate & Barrel Connects Shoppers with Relevant Products
How Crate & Barrel Connects Shoppers with Relevant ProductsHow Crate & Barrel Connects Shoppers with Relevant Products
How Crate & Barrel Connects Shoppers with Relevant Products
 
Lucidworks & IMRG Webinar – Best-In-Class Retail Product Discovery
Lucidworks & IMRG Webinar – Best-In-Class Retail Product DiscoveryLucidworks & IMRG Webinar – Best-In-Class Retail Product Discovery
Lucidworks & IMRG Webinar – Best-In-Class Retail Product Discovery
 
Connected Experiences Are Personalized Experiences
Connected Experiences Are Personalized ExperiencesConnected Experiences Are Personalized Experiences
Connected Experiences Are Personalized Experiences
 
Intelligent Insight Driven Policing with MC+A, Toronto Police Service and Luc...
Intelligent Insight Driven Policing with MC+A, Toronto Police Service and Luc...Intelligent Insight Driven Policing with MC+A, Toronto Police Service and Luc...
Intelligent Insight Driven Policing with MC+A, Toronto Police Service and Luc...
 
[Webinar] Intelligent Policing. Leveraging Data to more effectively Serve Com...
[Webinar] Intelligent Policing. Leveraging Data to more effectively Serve Com...[Webinar] Intelligent Policing. Leveraging Data to more effectively Serve Com...
[Webinar] Intelligent Policing. Leveraging Data to more effectively Serve Com...
 
Preparing for Peak in Ecommerce | eTail Asia 2020
Preparing for Peak in Ecommerce | eTail Asia 2020Preparing for Peak in Ecommerce | eTail Asia 2020
Preparing for Peak in Ecommerce | eTail Asia 2020
 
Accelerate The Path To Purchase With Product Discovery at Retail Innovation C...
Accelerate The Path To Purchase With Product Discovery at Retail Innovation C...Accelerate The Path To Purchase With Product Discovery at Retail Innovation C...
Accelerate The Path To Purchase With Product Discovery at Retail Innovation C...
 
AI-Powered Linguistics and Search with Fusion and Rosette
AI-Powered Linguistics and Search with Fusion and RosetteAI-Powered Linguistics and Search with Fusion and Rosette
AI-Powered Linguistics and Search with Fusion and Rosette
 
The Service Industry After COVID-19: The Soul of Service in a Virtual Moment
The Service Industry After COVID-19: The Soul of Service in a Virtual MomentThe Service Industry After COVID-19: The Soul of Service in a Virtual Moment
The Service Industry After COVID-19: The Soul of Service in a Virtual Moment
 
Webinar: Smart answers for employee and customer support after covid 19 - Europe
Webinar: Smart answers for employee and customer support after covid 19 - EuropeWebinar: Smart answers for employee and customer support after covid 19 - Europe
Webinar: Smart answers for employee and customer support after covid 19 - Europe
 
Smart Answers for Employee and Customer Support After COVID-19
Smart Answers for Employee and Customer Support After COVID-19Smart Answers for Employee and Customer Support After COVID-19
Smart Answers for Employee and Customer Support After COVID-19
 
Applying AI & Search in Europe - featuring 451 Research
Applying AI & Search in Europe - featuring 451 ResearchApplying AI & Search in Europe - featuring 451 Research
Applying AI & Search in Europe - featuring 451 Research
 
Webinar: Accelerate Data Science with Fusion 5.1
Webinar: Accelerate Data Science with Fusion 5.1Webinar: Accelerate Data Science with Fusion 5.1
Webinar: Accelerate Data Science with Fusion 5.1
 
Webinar: 5 Must-Have Items You Need for Your 2020 Ecommerce Strategy
Webinar: 5 Must-Have Items You Need for Your 2020 Ecommerce StrategyWebinar: 5 Must-Have Items You Need for Your 2020 Ecommerce Strategy
Webinar: 5 Must-Have Items You Need for Your 2020 Ecommerce Strategy
 
Where Search Meets Science and Style Meets Savings: Nordstrom Rack's Journey ...
Where Search Meets Science and Style Meets Savings: Nordstrom Rack's Journey ...Where Search Meets Science and Style Meets Savings: Nordstrom Rack's Journey ...
Where Search Meets Science and Style Meets Savings: Nordstrom Rack's Journey ...
 
Apply Knowledge Graphs and Search for Real-World Decision Intelligence
Apply Knowledge Graphs and Search for Real-World Decision IntelligenceApply Knowledge Graphs and Search for Real-World Decision Intelligence
Apply Knowledge Graphs and Search for Real-World Decision Intelligence
 
Webinar: Building a Business Case for Enterprise Search
Webinar: Building a Business Case for Enterprise SearchWebinar: Building a Business Case for Enterprise Search
Webinar: Building a Business Case for Enterprise Search
 
Why Insight Engines Matter in 2020 and Beyond
Why Insight Engines Matter in 2020 and BeyondWhy Insight Engines Matter in 2020 and Beyond
Why Insight Engines Matter in 2020 and Beyond
 

Recently uploaded

Corporate Management | Session 3 of 3 | Tendenci AMS
Corporate Management | Session 3 of 3 | Tendenci AMSCorporate Management | Session 3 of 3 | Tendenci AMS
Corporate Management | Session 3 of 3 | Tendenci AMS
Tendenci - The Open Source AMS (Association Management Software)
 
Designing for Privacy in Amazon Web Services
Designing for Privacy in Amazon Web ServicesDesigning for Privacy in Amazon Web Services
Designing for Privacy in Amazon Web Services
KrzysztofKkol1
 
Large Language Models and the End of Programming
Large Language Models and the End of ProgrammingLarge Language Models and the End of Programming
Large Language Models and the End of Programming
Matt Welsh
 
How Recreation Management Software Can Streamline Your Operations.pptx
How Recreation Management Software Can Streamline Your Operations.pptxHow Recreation Management Software Can Streamline Your Operations.pptx
How Recreation Management Software Can Streamline Your Operations.pptx
wottaspaceseo
 
Cyaniclab : Software Development Agency Portfolio.pdf
Cyaniclab : Software Development Agency Portfolio.pdfCyaniclab : Software Development Agency Portfolio.pdf
Cyaniclab : Software Development Agency Portfolio.pdf
Cyanic lab
 
Into the Box 2024 - Keynote Day 2 Slides.pdf
Into the Box 2024 - Keynote Day 2 Slides.pdfInto the Box 2024 - Keynote Day 2 Slides.pdf
Into the Box 2024 - Keynote Day 2 Slides.pdf
Ortus Solutions, Corp
 
Exploring Innovations in Data Repository Solutions - Insights from the U.S. G...
Exploring Innovations in Data Repository Solutions - Insights from the U.S. G...Exploring Innovations in Data Repository Solutions - Insights from the U.S. G...
Exploring Innovations in Data Repository Solutions - Insights from the U.S. G...
Globus
 
Globus Connect Server Deep Dive - GlobusWorld 2024
Globus Connect Server Deep Dive - GlobusWorld 2024Globus Connect Server Deep Dive - GlobusWorld 2024
Globus Connect Server Deep Dive - GlobusWorld 2024
Globus
 
top nidhi software solution freedownload
top nidhi software solution freedownloadtop nidhi software solution freedownload
top nidhi software solution freedownload
vrstrong314
 
Enhancing Research Orchestration Capabilities at ORNL.pdf
Enhancing Research Orchestration Capabilities at ORNL.pdfEnhancing Research Orchestration Capabilities at ORNL.pdf
Enhancing Research Orchestration Capabilities at ORNL.pdf
Globus
 
Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...
Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...
Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...
Globus
 
De mooiste recreatieve routes ontdekken met RouteYou en FME
De mooiste recreatieve routes ontdekken met RouteYou en FMEDe mooiste recreatieve routes ontdekken met RouteYou en FME
De mooiste recreatieve routes ontdekken met RouteYou en FME
Jelle | Nordend
 
Globus Compute wth IRI Workflows - GlobusWorld 2024
Globus Compute wth IRI Workflows - GlobusWorld 2024Globus Compute wth IRI Workflows - GlobusWorld 2024
Globus Compute wth IRI Workflows - GlobusWorld 2024
Globus
 
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital TransformationWSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
WSO2
 
Developing Distributed High-performance Computing Capabilities of an Open Sci...
Developing Distributed High-performance Computing Capabilities of an Open Sci...Developing Distributed High-performance Computing Capabilities of an Open Sci...
Developing Distributed High-performance Computing Capabilities of an Open Sci...
Globus
 
Gamify Your Mind; The Secret Sauce to Delivering Success, Continuously Improv...
Gamify Your Mind; The Secret Sauce to Delivering Success, Continuously Improv...Gamify Your Mind; The Secret Sauce to Delivering Success, Continuously Improv...
Gamify Your Mind; The Secret Sauce to Delivering Success, Continuously Improv...
Shahin Sheidaei
 
A Comprehensive Look at Generative AI in Retail App Testing.pdf
A Comprehensive Look at Generative AI in Retail App Testing.pdfA Comprehensive Look at Generative AI in Retail App Testing.pdf
A Comprehensive Look at Generative AI in Retail App Testing.pdf
kalichargn70th171
 
Field Employee Tracking System| MiTrack App| Best Employee Tracking Solution|...
Field Employee Tracking System| MiTrack App| Best Employee Tracking Solution|...Field Employee Tracking System| MiTrack App| Best Employee Tracking Solution|...
Field Employee Tracking System| MiTrack App| Best Employee Tracking Solution|...
informapgpstrackings
 
Explore Modern SharePoint Templates for 2024
Explore Modern SharePoint Templates for 2024Explore Modern SharePoint Templates for 2024
Explore Modern SharePoint Templates for 2024
Sharepoint Designs
 
Advanced Flow Concepts Every Developer Should Know
Advanced Flow Concepts Every Developer Should KnowAdvanced Flow Concepts Every Developer Should Know
Advanced Flow Concepts Every Developer Should Know
Peter Caitens
 

Recently uploaded (20)

Corporate Management | Session 3 of 3 | Tendenci AMS
Corporate Management | Session 3 of 3 | Tendenci AMSCorporate Management | Session 3 of 3 | Tendenci AMS
Corporate Management | Session 3 of 3 | Tendenci AMS
 
Designing for Privacy in Amazon Web Services
Designing for Privacy in Amazon Web ServicesDesigning for Privacy in Amazon Web Services
Designing for Privacy in Amazon Web Services
 
Large Language Models and the End of Programming
Large Language Models and the End of ProgrammingLarge Language Models and the End of Programming
Large Language Models and the End of Programming
 
How Recreation Management Software Can Streamline Your Operations.pptx
How Recreation Management Software Can Streamline Your Operations.pptxHow Recreation Management Software Can Streamline Your Operations.pptx
How Recreation Management Software Can Streamline Your Operations.pptx
 
Cyaniclab : Software Development Agency Portfolio.pdf
Cyaniclab : Software Development Agency Portfolio.pdfCyaniclab : Software Development Agency Portfolio.pdf
Cyaniclab : Software Development Agency Portfolio.pdf
 
Into the Box 2024 - Keynote Day 2 Slides.pdf
Into the Box 2024 - Keynote Day 2 Slides.pdfInto the Box 2024 - Keynote Day 2 Slides.pdf
Into the Box 2024 - Keynote Day 2 Slides.pdf
 
Exploring Innovations in Data Repository Solutions - Insights from the U.S. G...
Exploring Innovations in Data Repository Solutions - Insights from the U.S. G...Exploring Innovations in Data Repository Solutions - Insights from the U.S. G...
Exploring Innovations in Data Repository Solutions - Insights from the U.S. G...
 
Globus Connect Server Deep Dive - GlobusWorld 2024
Globus Connect Server Deep Dive - GlobusWorld 2024Globus Connect Server Deep Dive - GlobusWorld 2024
Globus Connect Server Deep Dive - GlobusWorld 2024
 
top nidhi software solution freedownload
top nidhi software solution freedownloadtop nidhi software solution freedownload
top nidhi software solution freedownload
 
Enhancing Research Orchestration Capabilities at ORNL.pdf
Enhancing Research Orchestration Capabilities at ORNL.pdfEnhancing Research Orchestration Capabilities at ORNL.pdf
Enhancing Research Orchestration Capabilities at ORNL.pdf
 
Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...
Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...
Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...
 
De mooiste recreatieve routes ontdekken met RouteYou en FME
De mooiste recreatieve routes ontdekken met RouteYou en FMEDe mooiste recreatieve routes ontdekken met RouteYou en FME
De mooiste recreatieve routes ontdekken met RouteYou en FME
 
Globus Compute wth IRI Workflows - GlobusWorld 2024
Globus Compute wth IRI Workflows - GlobusWorld 2024Globus Compute wth IRI Workflows - GlobusWorld 2024
Globus Compute wth IRI Workflows - GlobusWorld 2024
 
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital TransformationWSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
 
Developing Distributed High-performance Computing Capabilities of an Open Sci...
Developing Distributed High-performance Computing Capabilities of an Open Sci...Developing Distributed High-performance Computing Capabilities of an Open Sci...
Developing Distributed High-performance Computing Capabilities of an Open Sci...
 
Gamify Your Mind; The Secret Sauce to Delivering Success, Continuously Improv...
Gamify Your Mind; The Secret Sauce to Delivering Success, Continuously Improv...Gamify Your Mind; The Secret Sauce to Delivering Success, Continuously Improv...
Gamify Your Mind; The Secret Sauce to Delivering Success, Continuously Improv...
 
A Comprehensive Look at Generative AI in Retail App Testing.pdf
A Comprehensive Look at Generative AI in Retail App Testing.pdfA Comprehensive Look at Generative AI in Retail App Testing.pdf
A Comprehensive Look at Generative AI in Retail App Testing.pdf
 
Field Employee Tracking System| MiTrack App| Best Employee Tracking Solution|...
Field Employee Tracking System| MiTrack App| Best Employee Tracking Solution|...Field Employee Tracking System| MiTrack App| Best Employee Tracking Solution|...
Field Employee Tracking System| MiTrack App| Best Employee Tracking Solution|...
 
Explore Modern SharePoint Templates for 2024
Explore Modern SharePoint Templates for 2024Explore Modern SharePoint Templates for 2024
Explore Modern SharePoint Templates for 2024
 
Advanced Flow Concepts Every Developer Should Know
Advanced Flow Concepts Every Developer Should KnowAdvanced Flow Concepts Every Developer Should Know
Advanced Flow Concepts Every Developer Should Know
 

Searching Images by Color: Presented by Chris Becker, Shutterstock

  • 1.
  • 2. Searching Images by Color Chris Becker Search Engineering @ Shutterstock
  • 3. What is Shutterstock?! • Shutterstock sells stock images, videos & music.! • Crowdsourced from artists around the world! • Shutterstock reviews and indexes them for search! • Customers by a subscription and download them!
  • 4. Why search by color?!
  • 5. Stock photography on the internet…!
  • 6. Stock photography on the internet…!
  • 7. Color is one of several visual attributes that you can use ! to create an engaging ! image search experience!
  • 10. Color Spaces! • RGB! ! • HSL! ! • LCH! ! • Lab!
  • 11. Calculating Distances Between Colors! • Euclidean distance works reasonably well in any color space! ! distRGB = sqrt((r1-r2)^2 + (g1-g2)^2 + (b1-b2)^2)! distHSL = sqrt((h1-h2)^2 + (s1-s2)^2 + (l1-l2)^2)! distLCH = sqrt((L1-L2)^2 + (C1-C2)^2 + (H1-H2)^2)! ! • More sophisticated equations that better account for human perception can be found at! http://en.wikipedia.org/wiki/Color_difference! !
  • 12. Images are just numbers! [ [[054,087,058], [054,116,206], [017,226,194], [234,203,215], [188,205,000], [229,156,182]], [[214,238,109], [064,190,104], [191,024,161], [104,071,036], [222,081,005], [204,012,113]], [[197,100,189], [159,204,024], [228,214,054], [250,098,125], [050,144,093], [021,122,101]], [[255,146,010], [115,156,002], [174,023,137], [161,141,077], [154,189,005], [242,170,074]], [[113,146,064], [196,057,200], [123,203,160], [066,090,234], [200,186,103], [099,074,037]], [[194,022,018], [226,045,008], [123,023,087], [171,029,021], [040,001,143], [255,083,194]], [[115,186,246], [025,064,109], [029,071,001], [140,031,002], [248,170,244], [134,112,252]], [[116,179,059], [217,205,159], [157,060,251], [151,205,058], [036,214,075], [107,103,130]], [[052,003,227], [184,037,078], [161,155,181], [051,070,186], [082,235,108], [129,233,211]], [[047,212,209], [250,236,085], [038,128,148], [115,171,113], [186,092,227], [198,130,024]], [[225,210,064], [123,049,199], [173,207,164], [161,069,220], [002,228,184], [170,248,075]], [[234,157,201], [168,027,113], [117,080,236], [168,131,247], [028,177,060], [187,147,084]], [[184,166,096], [107,117,037], [154,208,093], [237,090,188], [007,076,086], [224,239,210]], [[105,230,058], [002,122,240], [036,151,107], [101,023,149], [048,010,225], [109,102,195]], [[050,019,169], [219,235,027], [061,064,133], [218,221,113], [009,032,125], [109,151,137]], [[010,037,189], [216,010,101], [000,037,084], [166,225,127], [203,067,214], [110,020,245]], [[180,147,130], [045,251,177], [127,175,215], [237,161,084], [208,027,218], [244,194,034]], [[089,235,226], [106,219,220], [010,040,006], [094,138,058], [148,081,166], [249,216,177]], [[121,110,034], [007,232,255], [214,052,035], [086,100,020], [191,064,105], [129,254,207]], ]
  • 13. Any operation you can do on a set of numbers, you can do on an image! • getting histograms! • computing median values! • standard deviations / variance! • other statistics !
  • 14.
  • 16. Tools & Libraries! • ImageMagick! • Python Image Library! • ImageJ!
  • 17. Code Example! #! /usr/bin/env perl! use Image::Magick;! ! my $image = Image::Magick->new;! $image->Read(‘SamplePhoto.jpg’);! $image->Quantize(colorspace => 'RGB', colors => 64);! my @histogram = $image->Histogram();! my %colors;! ! while ( my($R,$G,$B,$opacity,$count) = splice(@histogram,0,5)) {! ! # convert r,g,b to a hex color value! my $hex = sprintf("%02x%02x%02x",! $R / 256,! $G / 256,! $B / 256! );! ! $colors{$hex} += $count; ! }!
  • 19. Indexing color histograms! • index colors just like you would index text! • volume of color == frequency of the term! color_txt = "cfebc2 cfebc2 cfebc2 cfebc2 cfebc2 2e6b2e 2e6b2e 2e6b2e ff0000 …"
  • 20. Solr Fields & Queries! <field name="color" type="text_ws" …>! • Easy to query! • Can use solr’s default ranking effectively! ! /solr/select?q=ff0000 e2c2d2&qf=color&defType=edismax…! ! • or access term frequencies directly to create specific sort functions:! ! sort=product(tf(color,"ff0000"),tf(color,"e2c2d2")) desc!
  • 21. Indexing color statistics! Represent aggregate statistics of each image! lightness: median: 2 standard dev: 1 largest bin: 0 largest bin size: 50 saturation median: 0 standard dev: 0 largest bin: 0 largest bin size: 100 …
  • 22. Solr Fields & Queries! <field name=”hue_median” type=”int” …>! • Sort by the distance between input param and median value! ! /solr/select?q=*&sort=abs(sub($query,hue_median)) asc!
  • 24. How much of the image has the color ? !
  • 25. is this relevant if I search for ?!
  • 26. which image is more relevant if I search for ?!
  • 27. is this relevant if I search for ?!
  • 28. How do we account for these factors?!
  • 29. How much of the image contains the selected color?! • Score each color by number/percentage of pixels! ! sort=tf(color,"ff9900") desc!
  • 30. Color Accuracy! • As you reduce your color space, you also reduce precision! • reducing the colorspace too much increases recall and lowers precision. ! • Not reducing it enough lowers recall and higher precision.! • reducing your color space down to ~100 to ~300 colors works well!
  • 31. Weighing Multiple Colors Equally! • If you search for 2 or more colors, the top result should have the most even distribution of those colors! • simple option:! ! sort=product(tf(color,"ff9900"),tf(color,"2280e2")) desc! ! • more complex: compute the stdev or variance of the matching color values in your solr sort function, and sort the results with the lowest variance first. ! !
  • 32. Accounting for Similar & Different Colors! • The score for a particular color should reflect all the colors in the image.! • At indexing time, increase the score based on similar colors; decrease it based on differing colors.!
  • 34. Conclusion! • This talk provided a rough guide to building a basic search-by-color application! • Lots of opportunity to do more sophisticated things in image search. ! • matching colors in certain parts of an image! • identifying visual styles (blur vs sharp, high contrast, etc)! • patterns & textures! • analyzing content in images (object detection)! ! !