{"id":21271,"date":"2015-02-19T15:40:55","date_gmt":"2015-02-19T15:40:55","guid":{"rendered":"http:\/\/how_to_automatically_identify_similar_images_using_phash"},"modified":"2025-10-29T12:59:22","modified_gmt":"2025-10-29T19:59:22","slug":"how_to_automatically_identify_similar_images_using_phash","status":"publish","type":"post","link":"https:\/\/cloudinary.com\/blog\/how_to_automatically_identify_similar_images_using_phash","title":{"rendered":"pHash Image Similarity | Automatically Identify Similar Images Using pHash"},"content":{"rendered":"<div class=\"wp-block-cloudinary-markdown \"><p>Photos today can be easily edited by means of resizing, cropping, adjusting the contrast, or changing an image\u2019s format. As a result, new images are created that are similar to the original ones. Websites, web applications and mobile apps that allow user generated content uploads can benefit from identifying similar images.<\/p>\n<div style=\"clear: both\">\n<\/div>\n<h2>Perceptual Hashing pHash Image Deduplication<\/h2>\n<p>If your site allows users to upload images, they can also upload various processed or transformed versions of the same image. As described above, while the versions are not exactly identical, they are quite similar.<\/p>\n<p>Obviously, it\u2019s good practice to show several different images on a single page and avoid displaying similar images. For example, travel sites might want to show different images of a hotel room, but avoid having similar images of the room on the same page.<\/p>\n<p>Additionally, if your web application deals with many uploaded images, you may want to be able to automatically recognize if newly uploaded images are similar to previously uploaded images. Recognizing similar images can prevent duplicate images from being used once they are uploaded, allowing you to better organize your site\u2019s content. The better your web application is better at identifying similar images upon upload, the more duplicated images will no longer be a thing.<\/p>\n<p>Duplicated images will no longer be a thing because similar images upon upload will be identified automatically.<\/p>\n<h2>Perceptual Hash pHash Image Duplicate Detection<\/h2>\n<p>Cloudinary uses <a href=\"http:\/\/www.phash.org\/\">perceptual hash (pHash)<\/a>, which acts as an image fingerprint. This mathematical algorithm analyzes an image\u2019s content and represents it using a 64-bit number fingerprint. Two images\u2019 pHash values are \u201cclose\u201d to one another if the images\u2019 content features are similar. By comparing two image fingerprints, you can tell if they are similar.<\/p>\n<blockquote>\n<p>Not using Cloudinary? You can use it for pHash image similarity recognition as well as the full suite of functionality for free and for life! <a href=\"https:\/\/cloudinary.com\/users\/register\/free\">Sign up for Cloudinary<\/a> now to get started.<\/p>\n<\/blockquote>\n<p>You can request the pHash value of an image from Cloudinary for any uploaded image, either using Cloudinary\u2019s upload API, or for any previously uploaded image in your media library using our admin API. You can simply set the <code>phash<\/code> parameter to <code>true<\/code>, which produces the image\u2019s pHash value. This image similarity algorithm is incredibly powerful and easy to use. Check out the example below:<\/p>\n<p>Using the following image for example:\n<a class=\"c-image-link\" href=\"https:\/\/res.cloudinary.com\/demo\/image\/upload\/f_auto,q_auto\/koala1.jpg\" target=\"_blank\"><img decoding=\"async\" src=\"https:\/\/res.cloudinary.com\/demo\/image\/upload\/f_auto,q_auto\/w_400\/koala1.jpg\" alt=\"Image of a koala to be used in the perceptual hash phash image duplicate detection project.\" loading=\"lazy\" class=\"c-transformed-asset\"  width=\"400\" height=\"253\"\/><\/a><\/p>\n<p>Below is a code sample in Ruby that shows how to upload this image with a request for the pHash value:<\/p>\n<pre class=\"js-syntax-highlighted\" aria-describedby=\"shcb-language-1\" data-shcb-language-name=\"JavaScript\" data-shcb-language-slug=\"javascript\"><span><code class=\"hljs language-javascript shcb-wrap-lines\">Cloudinary::Uploader.upload(<span class=\"hljs-string\">\"koala1.jpg\"<\/span>, :<span class=\"hljs-function\"><span class=\"hljs-params\">public_id<\/span> =&gt;<\/span> <span class=\"hljs-string\">\"koala1\"<\/span>, :<span class=\"hljs-function\"><span class=\"hljs-params\">phash<\/span> =&gt;<\/span> <span class=\"hljs-literal\">true<\/span>)\n<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-1\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">JavaScript<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">javascript<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n<p>The result below shows the returned response with the calculated pHash value:<\/p>\n<pre class=\"js-syntax-highlighted\" aria-describedby=\"shcb-language-2\" data-shcb-language-name=\"JavaScript\" data-shcb-language-slug=\"javascript\"><span><code class=\"hljs language-javascript shcb-wrap-lines\">    {\n     <span class=\"hljs-string\">\"public_id\"<\/span>: <span class=\"hljs-string\">\"koala1\"<\/span>,\n     <span class=\"hljs-string\">\"version\"<\/span>: <span class=\"hljs-number\">1424266415<\/span>,\n     <span class=\"hljs-string\">\"width\"<\/span>: <span class=\"hljs-number\">887<\/span>,\n     <span class=\"hljs-string\">\"height\"<\/span>: <span class=\"hljs-number\">562<\/span>,\n     <span class=\"hljs-string\">\"format\"<\/span>: <span class=\"hljs-string\">\"jpg\"<\/span>,\n     <span class=\"hljs-string\">\"etag\"<\/span>: <span class=\"hljs-string\">\"6f821ea4478af3e3a183721c0755cb1b\"<\/span>,\n    ...\n     <span class=\"hljs-string\">\"phash\"<\/span>: <span class=\"hljs-string\">\"ba19c8ab5fa05a59\"<\/span>\n    }\n<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-2\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">JavaScript<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">javascript<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n<p>The examples below demonstrate multiple similar images and their pHash values. Let\u2019s compare the pHash values and find the distance between each pair. If you XOR two of the pHash values and count the \u201c1\u2019s\u201d in the result, you get a value between 0-64. The lower the value, the more similar the images are. If all 64 bits are the same, the photos are very similar.<\/p>\n<p>The similarity score of the examples below expresses how each image is similar to the original image. The score is calculated as <code>1 - (phash_distance(phash1, phash2) \/ 64.0)<\/code> in order to give a result between 0.5 and 1 (phash_distance can be computed using <code>bit_count(phash1 ^ phash2)<\/code> in MySQL for example).<\/p>\n<p><a class=\"c-image-link\" href=\"https:\/\/res.cloudinary.com\/demo\/image\/upload\/koala1.jpg\" target=\"_blank\"><img decoding=\"async\" src=\"https:\/\/res.cloudinary.com\/demo\/image\/upload\/h_180\/koala1.jpg\" alt=\"Image showing a koala to be used in the perceptual hash phash image duplicate detection project with Phash score set\" loading=\"lazy\" class=\"c-transformed-asset\"  width=\"284\" height=\"180\"\/><\/a>\n<em>887&#215;562 JPEG, 180 KB<\/em><br\/>\n<em>pHash:<\/em> <strong>ba19c8ab5fa05a59<\/strong><br\/>\n<br\/><\/p>\n<p><a class=\"c-image-link\" href=\"https:\/\/res.cloudinary.com\/demo\/image\/upload\/koala2.jpg\" target=\"_blank\"><img decoding=\"async\" src=\"https:\/\/res.cloudinary.com\/demo\/image\/upload\/h_180\/koala2.jpg\" alt=\"Image showing a koala in black and white to be used in the perceptual hashing phash image deduplication project with Phash similarity score of about 97%\" loading=\"lazy\" class=\"c-transformed-asset\"  width=\"284\" height=\"180\"\/><\/a>\n<em>887&#215;562 JPEG, 149 KB<\/em><br\/>\n<em>Difference:<\/em> <strong>grayscale.<\/strong><br\/>\n<em>pHash:<\/em> <strong>ba19caab5f205a59<\/strong><br\/>\n<em>Similarity score:<\/em> <strong>0.96875<\/strong><br\/>\n<br\/><\/p>\n<p><a class=\"c-image-link\" href=\"https:\/\/res.cloudinary.com\/demo\/image\/upload\/koala3.jpg\" target=\"_blank\"><img decoding=\"async\" src=\"https:\/\/res.cloudinary.com\/demo\/image\/upload\/h_180\/koala3.jpg\" alt=\"Image showing a koala with increased color saturation to be used in the perceptual hashing phash image deduplication project with Phash similarity score of about 78%\" loading=\"lazy\" class=\"c-transformed-asset\"  width=\"255\" height=\"180\"\/><\/a>\n<em>797&#215;562 JPEG, 179 KB<\/em><br\/>\n<em>Difference:<\/em> <strong>cropped, increased color saturation.<\/strong><br\/>\n<em>pHash:<\/em> <strong>ba3dcfabbc004a49<\/strong><br\/>\n<em>Similarity score:<\/em> <strong>0.78125<\/strong><br\/>\n<br\/><\/p>\n<p><a class=\"c-image-link\" href=\"https:\/\/res.cloudinary.com\/demo\/image\/upload\/koala4.jpg\" target=\"_blank\"><img decoding=\"async\" src=\"https:\/\/res.cloudinary.com\/demo\/image\/upload\/h_180\/koala4.jpg\" alt=\"Image showing a koala with cropping and lower quality to be used in the perceptual hashing phash image deduplication project with Phash similarity score of about 81%\" loading=\"lazy\" class=\"c-transformed-asset\"  width=\"314\" height=\"180\"\/><\/a>\n<em>887&#215;509 JPEG, 30.6 KB<\/em> <br\/>\n<em>Difference:<\/em> <strong>cropped, lower JPEG quality.<\/strong><br\/>\n<em>pHash:<\/em> <strong>1b39ccea7d304a59<\/strong><br\/>\n<em>Similarity score:<\/em> <strong>0.8125<\/strong><br\/>\n<br\/><\/p>\n<p><a class=\"c-image-link\" href=\"https:\/\/res.cloudinary.com\/demo\/image\/upload\/another_koala.jpg\" target=\"_blank\"><img decoding=\"async\" src=\"https:\/\/res.cloudinary.com\/demo\/image\/upload\/h_180\/another_koala.jpg\" alt=\"Image showing a different koala to be used in the perceptual hashing phash image deduplication project with Phash similarity score of about 56%.\" loading=\"lazy\" class=\"c-transformed-asset\"  width=\"270\" height=\"180\"\/><\/a>\n<em>1000&#215;667 JPEG, 608 KB<\/em><br\/>\n<em>Difference:<\/em> <strong>a different koala photo\u2026<\/strong><br\/>\n<em>pHash:<\/em> <strong>3d419c23c42eb3db<\/strong><br\/>\n<em>Similarity score:<\/em> <strong>0.5625<\/strong><br\/>\n<br\/><\/p>\n<p><a class=\"c-image-link\" href=\"https:\/\/res.cloudinary.com\/demo\/image\/upload\/woman1.jpg\" target=\"_blank\"><img decoding=\"async\" src=\"https:\/\/res.cloudinary.com\/demo\/image\/upload\/h_180\/woman1.jpg\" alt=\"Image of a woman\u2019s face that has a perceptual hash phash image similarity score of about 50%\" loading=\"lazy\" class=\"c-transformed-asset\"  width=\"262\" height=\"180\"\/><\/a>\n<em>1000&#215;688 JPEG, 569 KB<\/em><br\/>\n<em>Difference:<\/em> <strong>not a koala\u2026<\/strong><br\/>\n<em>pHash:<\/em> <strong>f10773f1cd269246<\/strong><br\/>\n<em>Similarity score:<\/em> <strong>0.5<\/strong><br\/>\n<br\/><\/p>\n<p>As you can see from the results above, the three images that appear to be similar to the original received a high score when they were compared. While other comparison results showed significantly less similarity.<\/p>\n<p>By using <a href=\"https:\/\/cloudinary.com\/\">Cloudinary<\/a> to upload users\u2019 photos to your site or application, you can request the pHash values of the uploaded images and store them on your servers. That allows you to identify which images are similar and decide what the next step should be. Building image matcher type of apps would be a lot easier. You may want to keep similar images, classify them in your database, filter them out, or interactively allow users to decide which images they want to keep.<\/p>\n<h2>Summary<\/h2>\n<p>All Cloudinary users have access to check perceptual hash (pHash) image similarity, including <a href=\"https:\/\/cloudinary.com\/users\/register\/free\">free-for-life users<\/a>. As explained above, you can use Cloudinary\u2019s API to get an image\u2019s fingerprint and start checking for similarities. In addition, it is in our roadmap to further enhance our similar image search and deduplication capabilities.<\/p>\n<\/div>","protected":false},"excerpt":{"rendered":"","protected":false},"author":41,"featured_media":21272,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"_cloudinary_featured_overwrite":false,"footnotes":""},"categories":[1],"tags":[91,92,151,176,177,183,214,229,257],"class_list":["post-21271","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-uncategorized","tag-django","tag-dotnet","tag-image-analysis","tag-java","tag-javascript","tag-jquery","tag-node","tag-php","tag-ruby-on-rails"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v25.6 (Yoast SEO v26.9) - https:\/\/yoast.com\/product\/yoast-seo-premium-wordpress\/ -->\n<title>pHash Image Similarity | Automatically Identify Similar Images Using pHash<\/title>\n<meta name=\"description\" content=\"How to use Perceptual Hash pHash image duplicate detection to identify similar and duplicate images with pHash, to better organize media on your website.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/cloudinary.com\/blog\/how_to_automatically_identify_similar_images_using_phash\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"pHash Image Similarity | Automatically Identify Similar Images Using pHash\" \/>\n<meta property=\"og:description\" content=\"How to use Perceptual Hash pHash image duplicate detection to identify similar and duplicate images with pHash, to better organize media on your website.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/cloudinary.com\/blog\/how_to_automatically_identify_similar_images_using_phash\" \/>\n<meta property=\"og:site_name\" content=\"Cloudinary Blog\" \/>\n<meta property=\"article:published_time\" content=\"2015-02-19T15:40:55+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2025-10-29T19:59:22+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/res.cloudinary.com\/cloudinary-marketing\/images\/f_auto,q_auto\/v1649718902\/Web_Assets\/blog\/06_automatically_identify\/06_automatically_identify.jpg?_i=AA\" \/>\n\t<meta property=\"og:image:width\" content=\"1540\" \/>\n\t<meta property=\"og:image:height\" content=\"847\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"NewsArticle\",\"@id\":\"https:\/\/cloudinary.com\/blog\/how_to_automatically_identify_similar_images_using_phash#article\",\"isPartOf\":{\"@id\":\"https:\/\/cloudinary.com\/blog\/how_to_automatically_identify_similar_images_using_phash\"},\"author\":{\"name\":\"\",\"@id\":\"\"},\"headline\":\"pHash Image Similarity | Automatically Identify Similar Images Using pHash\",\"datePublished\":\"2015-02-19T15:40:55+00:00\",\"dateModified\":\"2025-10-29T19:59:22+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/cloudinary.com\/blog\/how_to_automatically_identify_similar_images_using_phash\"},\"wordCount\":9,\"publisher\":{\"@id\":\"https:\/\/cloudinary.com\/blog\/#organization\"},\"image\":{\"@id\":\"https:\/\/cloudinary.com\/blog\/how_to_automatically_identify_similar_images_using_phash#primaryimage\"},\"thumbnailUrl\":\"https:\/\/res.cloudinary.com\/cloudinary-marketing\/images\/f_auto,q_auto\/v1649718902\/Web_Assets\/blog\/06_automatically_identify\/06_automatically_identify.jpg?_i=AA\",\"keywords\":[\"Django\",\"DotNet\",\"Image Analysis\",\"Java\",\"Javascript\",\"jQuery\",\"Node\",\"PHP\",\"Ruby on Rails\"],\"inLanguage\":\"en-US\",\"copyrightYear\":\"2015\",\"copyrightHolder\":{\"@id\":\"https:\/\/cloudinary.com\/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/cloudinary.com\/blog\/how_to_automatically_identify_similar_images_using_phash\",\"url\":\"https:\/\/cloudinary.com\/blog\/how_to_automatically_identify_similar_images_using_phash\",\"name\":\"pHash Image Similarity | Automatically Identify Similar Images Using pHash\",\"isPartOf\":{\"@id\":\"https:\/\/cloudinary.com\/blog\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/cloudinary.com\/blog\/how_to_automatically_identify_similar_images_using_phash#primaryimage\"},\"image\":{\"@id\":\"https:\/\/cloudinary.com\/blog\/how_to_automatically_identify_similar_images_using_phash#primaryimage\"},\"thumbnailUrl\":\"https:\/\/res.cloudinary.com\/cloudinary-marketing\/images\/f_auto,q_auto\/v1649718902\/Web_Assets\/blog\/06_automatically_identify\/06_automatically_identify.jpg?_i=AA\",\"datePublished\":\"2015-02-19T15:40:55+00:00\",\"dateModified\":\"2025-10-29T19:59:22+00:00\",\"description\":\"How to use Perceptual Hash pHash image duplicate detection to identify similar and duplicate images with pHash, to better organize media on your website.\",\"breadcrumb\":{\"@id\":\"https:\/\/cloudinary.com\/blog\/how_to_automatically_identify_similar_images_using_phash#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/cloudinary.com\/blog\/how_to_automatically_identify_similar_images_using_phash\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/cloudinary.com\/blog\/how_to_automatically_identify_similar_images_using_phash#primaryimage\",\"url\":\"https:\/\/res.cloudinary.com\/cloudinary-marketing\/images\/f_auto,q_auto\/v1649718902\/Web_Assets\/blog\/06_automatically_identify\/06_automatically_identify.jpg?_i=AA\",\"contentUrl\":\"https:\/\/res.cloudinary.com\/cloudinary-marketing\/images\/f_auto,q_auto\/v1649718902\/Web_Assets\/blog\/06_automatically_identify\/06_automatically_identify.jpg?_i=AA\",\"width\":1540,\"height\":847,\"caption\":\"Image showing a koala to be used in the perceptual hash phash image duplicate detection project\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/cloudinary.com\/blog\/how_to_automatically_identify_similar_images_using_phash#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/cloudinary.com\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"pHash Image Similarity | Automatically Identify Similar Images Using pHash\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/cloudinary.com\/blog\/#website\",\"url\":\"https:\/\/cloudinary.com\/blog\/\",\"name\":\"Cloudinary Blog\",\"description\":\"\",\"publisher\":{\"@id\":\"https:\/\/cloudinary.com\/blog\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/cloudinary.com\/blog\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/cloudinary.com\/blog\/#organization\",\"name\":\"Cloudinary Blog\",\"url\":\"https:\/\/cloudinary.com\/blog\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/cloudinary.com\/blog\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/res.cloudinary.com\/cloudinary-marketing\/images\/f_auto,q_auto\/v1649718331\/Web_Assets\/blog\/cloudinary_logo_for_white_bg_1937437aa7_19374666c7_193742f877\/cloudinary_logo_for_white_bg_1937437aa7_19374666c7_193742f877.png?_i=AA\",\"contentUrl\":\"https:\/\/res.cloudinary.com\/cloudinary-marketing\/images\/f_auto,q_auto\/v1649718331\/Web_Assets\/blog\/cloudinary_logo_for_white_bg_1937437aa7_19374666c7_193742f877\/cloudinary_logo_for_white_bg_1937437aa7_19374666c7_193742f877.png?_i=AA\",\"width\":312,\"height\":60,\"caption\":\"Cloudinary Blog\"},\"image\":{\"@id\":\"https:\/\/cloudinary.com\/blog\/#\/schema\/logo\/image\/\"}},{\"@type\":\"Person\",\"@id\":\"\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"pHash Image Similarity | Automatically Identify Similar Images Using pHash","description":"How to use Perceptual Hash pHash image duplicate detection to identify similar and duplicate images with pHash, to better organize media on your website.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/cloudinary.com\/blog\/how_to_automatically_identify_similar_images_using_phash","og_locale":"en_US","og_type":"article","og_title":"pHash Image Similarity | Automatically Identify Similar Images Using pHash","og_description":"How to use Perceptual Hash pHash image duplicate detection to identify similar and duplicate images with pHash, to better organize media on your website.","og_url":"https:\/\/cloudinary.com\/blog\/how_to_automatically_identify_similar_images_using_phash","og_site_name":"Cloudinary Blog","article_published_time":"2015-02-19T15:40:55+00:00","article_modified_time":"2025-10-29T19:59:22+00:00","og_image":[{"width":1540,"height":847,"url":"https:\/\/res.cloudinary.com\/cloudinary-marketing\/images\/f_auto,q_auto\/v1649718902\/Web_Assets\/blog\/06_automatically_identify\/06_automatically_identify.jpg?_i=AA","type":"image\/jpeg"}],"twitter_card":"summary_large_image","schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"NewsArticle","@id":"https:\/\/cloudinary.com\/blog\/how_to_automatically_identify_similar_images_using_phash#article","isPartOf":{"@id":"https:\/\/cloudinary.com\/blog\/how_to_automatically_identify_similar_images_using_phash"},"author":{"name":"","@id":""},"headline":"pHash Image Similarity | Automatically Identify Similar Images Using pHash","datePublished":"2015-02-19T15:40:55+00:00","dateModified":"2025-10-29T19:59:22+00:00","mainEntityOfPage":{"@id":"https:\/\/cloudinary.com\/blog\/how_to_automatically_identify_similar_images_using_phash"},"wordCount":9,"publisher":{"@id":"https:\/\/cloudinary.com\/blog\/#organization"},"image":{"@id":"https:\/\/cloudinary.com\/blog\/how_to_automatically_identify_similar_images_using_phash#primaryimage"},"thumbnailUrl":"https:\/\/res.cloudinary.com\/cloudinary-marketing\/images\/f_auto,q_auto\/v1649718902\/Web_Assets\/blog\/06_automatically_identify\/06_automatically_identify.jpg?_i=AA","keywords":["Django","DotNet","Image Analysis","Java","Javascript","jQuery","Node","PHP","Ruby on Rails"],"inLanguage":"en-US","copyrightYear":"2015","copyrightHolder":{"@id":"https:\/\/cloudinary.com\/#organization"}},{"@type":"WebPage","@id":"https:\/\/cloudinary.com\/blog\/how_to_automatically_identify_similar_images_using_phash","url":"https:\/\/cloudinary.com\/blog\/how_to_automatically_identify_similar_images_using_phash","name":"pHash Image Similarity | Automatically Identify Similar Images Using pHash","isPartOf":{"@id":"https:\/\/cloudinary.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/cloudinary.com\/blog\/how_to_automatically_identify_similar_images_using_phash#primaryimage"},"image":{"@id":"https:\/\/cloudinary.com\/blog\/how_to_automatically_identify_similar_images_using_phash#primaryimage"},"thumbnailUrl":"https:\/\/res.cloudinary.com\/cloudinary-marketing\/images\/f_auto,q_auto\/v1649718902\/Web_Assets\/blog\/06_automatically_identify\/06_automatically_identify.jpg?_i=AA","datePublished":"2015-02-19T15:40:55+00:00","dateModified":"2025-10-29T19:59:22+00:00","description":"How to use Perceptual Hash pHash image duplicate detection to identify similar and duplicate images with pHash, to better organize media on your website.","breadcrumb":{"@id":"https:\/\/cloudinary.com\/blog\/how_to_automatically_identify_similar_images_using_phash#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/cloudinary.com\/blog\/how_to_automatically_identify_similar_images_using_phash"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/cloudinary.com\/blog\/how_to_automatically_identify_similar_images_using_phash#primaryimage","url":"https:\/\/res.cloudinary.com\/cloudinary-marketing\/images\/f_auto,q_auto\/v1649718902\/Web_Assets\/blog\/06_automatically_identify\/06_automatically_identify.jpg?_i=AA","contentUrl":"https:\/\/res.cloudinary.com\/cloudinary-marketing\/images\/f_auto,q_auto\/v1649718902\/Web_Assets\/blog\/06_automatically_identify\/06_automatically_identify.jpg?_i=AA","width":1540,"height":847,"caption":"Image showing a koala to be used in the perceptual hash phash image duplicate detection project"},{"@type":"BreadcrumbList","@id":"https:\/\/cloudinary.com\/blog\/how_to_automatically_identify_similar_images_using_phash#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/cloudinary.com\/blog\/"},{"@type":"ListItem","position":2,"name":"pHash Image Similarity | Automatically Identify Similar Images Using pHash"}]},{"@type":"WebSite","@id":"https:\/\/cloudinary.com\/blog\/#website","url":"https:\/\/cloudinary.com\/blog\/","name":"Cloudinary Blog","description":"","publisher":{"@id":"https:\/\/cloudinary.com\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/cloudinary.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/cloudinary.com\/blog\/#organization","name":"Cloudinary Blog","url":"https:\/\/cloudinary.com\/blog\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/cloudinary.com\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/res.cloudinary.com\/cloudinary-marketing\/images\/f_auto,q_auto\/v1649718331\/Web_Assets\/blog\/cloudinary_logo_for_white_bg_1937437aa7_19374666c7_193742f877\/cloudinary_logo_for_white_bg_1937437aa7_19374666c7_193742f877.png?_i=AA","contentUrl":"https:\/\/res.cloudinary.com\/cloudinary-marketing\/images\/f_auto,q_auto\/v1649718331\/Web_Assets\/blog\/cloudinary_logo_for_white_bg_1937437aa7_19374666c7_193742f877\/cloudinary_logo_for_white_bg_1937437aa7_19374666c7_193742f877.png?_i=AA","width":312,"height":60,"caption":"Cloudinary Blog"},"image":{"@id":"https:\/\/cloudinary.com\/blog\/#\/schema\/logo\/image\/"}},{"@type":"Person","@id":""}]}},"jetpack_featured_media_url":"https:\/\/res.cloudinary.com\/cloudinary-marketing\/images\/f_auto,q_auto\/v1649718902\/Web_Assets\/blog\/06_automatically_identify\/06_automatically_identify.jpg?_i=AA","_links":{"self":[{"href":"https:\/\/cloudinary.com\/blog\/wp-json\/wp\/v2\/posts\/21271","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/cloudinary.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/cloudinary.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/cloudinary.com\/blog\/wp-json\/wp\/v2\/users\/41"}],"replies":[{"embeddable":true,"href":"https:\/\/cloudinary.com\/blog\/wp-json\/wp\/v2\/comments?post=21271"}],"version-history":[{"count":2,"href":"https:\/\/cloudinary.com\/blog\/wp-json\/wp\/v2\/posts\/21271\/revisions"}],"predecessor-version":[{"id":39024,"href":"https:\/\/cloudinary.com\/blog\/wp-json\/wp\/v2\/posts\/21271\/revisions\/39024"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/cloudinary.com\/blog\/wp-json\/wp\/v2\/media\/21272"}],"wp:attachment":[{"href":"https:\/\/cloudinary.com\/blog\/wp-json\/wp\/v2\/media?parent=21271"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/cloudinary.com\/blog\/wp-json\/wp\/v2\/categories?post=21271"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/cloudinary.com\/blog\/wp-json\/wp\/v2\/tags?post=21271"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}