{"id":32627,"date":"2020-06-21T17:11:00","date_gmt":"2020-06-21T17:11:00","guid":{"rendered":"https:\/\/foojay.io\/?p=32627"},"modified":"2021-08-23T12:25:20","modified_gmt":"2021-08-23T12:25:20","slug":"how-does-java-handle-different-images-and-colorspaces-part-2","status":"publish","type":"post","link":"https:\/\/foojay.io\/today\/how-does-java-handle-different-images-and-colorspaces-part-2\/","title":{"rendered":"How does Java handle different Images and ColorSpaces \u2013 Part 2"},"content":{"rendered":"\n<p>There are lots of different ways of describing Color. As developers, we are most familiar with the RGB model, where every color is defined by mixing Red, Green and Blue together. In the print world, CMYK is very common, where colors or printed by literally mixing different amounts of Cyan, Magenta, Yellow and Key (black). You may also come across other ways of describing color such as DeviceN. There are also lots of different versions of RGB.<\/p>\n\n\n<p>Java is based on RGB and partially supports other ColorSpaces. The ColorSpace class itself defines lots of constants for ColorSpaces, along with some nice methods to convert to and from RGB and CIEXYZ (a mathematical ColorSpace useful for convert to and from other ColorSpaces with).<\/p>\n\n\n<div class=\"wp-block-image is-style-default\"><figure class=\"aligncenter\"><img decoding=\"async\" src=\"https:\/\/blog.idrsolutions.com\/wp-content\/uploads\/2019\/11\/Screenshot-2019-11-19-at-10.43.30-134x300.png\" alt=\"Java Colorspaces\" class=\"wp-image-27029\"\/><\/figure><\/div>\n\n\n<p>ColorSpaces can be defined using a CIE profile file and if you have one for a ColorSpace you can create an instance of the ColorSpace and convert color values between ColorSpaces). But BufferedImage itself only understands a more limited subset of formats.<\/p>\n\n\n<div class=\"wp-block-image is-style-default\"><figure class=\"aligncenter\"><img decoding=\"async\" src=\"https:\/\/blog.idrsolutions.com\/wp-content\/uploads\/2019\/11\/Screenshot-2019-11-19-at-10.41.31-300x126.png\" alt=\"BufferedImage colorspaces\" class=\"wp-image-27030\"\/><\/figure><\/div>\n\n\n<p>Java can generally load lots of image types and allow access to the raw Image data, but it does not fully understand the data \u2013 so you will get oddly coloured images like the one&nbsp;<a target=\"_blank\" href=\"https:\/\/blog.idrsolutions.com\/2011\/10\/ycck-color-conversion-in-pdf-files\/\">in this post<\/a>.<\/p>\n\n\n<p>If you wanted to view a CMYK image as a BufferedImage in Java directly, you would need to convert the Image data into RGB before you could display it properly. You would need an ICC CMYK profile to create a CMYK ColorSpace and then I should you how to transform the data&nbsp;<a target=\"_blank\" href=\"https:\/\/blog.idrsolutions.com\/2012\/02\/java-cmyk-to-rgb-conversion-speed-comparison-of-diy-versus-letting-java-do-it\/\">in this blog post.<\/a><\/p>\n\n\n<p>Next time we will talk more about BufferedImages.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>There are lots of different ways of describing Color. As developers, we are most familiar with the RGB model, where every color is defined by mixing Red, Green and Blue together. In the print world, CMYK is very common, where colors or printed by literally mixing different amounts of Cyan, Magenta, Yellow and Key (black). You may also come across other ways of describing color such as DeviceN. There are also lots of different versions of RGB.<\/p>\n<p>Next time we will talk more about BufferedImages.<\/p>\n","protected":false},"author":40,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[33,35],"class_list":["post-32627","post","type-post","status-publish","format-standard","hentry","category-uncategorized","tag-java","tag-openjdk"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.7 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>foojay \u2013 a place for friends of OpenJDK<\/title>\n<meta name=\"description\" content=\"foojay is the place for all OpenJDK Update Release Information. Learn More.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/foojay.io\/today\/how-does-java-handle-different-images-and-colorspaces-part-2\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"foojay \u2013 a place for friends of OpenJDK\" \/>\n<meta property=\"og:description\" content=\"foojay is the place for all OpenJDK Update Release Information. Learn More.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/foojay.io\/today\/how-does-java-handle-different-images-and-colorspaces-part-2\/\" \/>\n<meta property=\"og:site_name\" content=\"foojay\" \/>\n<meta property=\"article:published_time\" content=\"2020-06-21T17:11:00+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2021-08-23T12:25:20+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/blog.idrsolutions.com\/wp-content\/uploads\/2019\/11\/Screenshot-2019-11-19-at-10.43.30-134x300.png\" \/>\n<meta name=\"author\" content=\"Mark Stephens\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Mark Stephens\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"1 minute\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/foojay.io\\\/today\\\/how-does-java-handle-different-images-and-colorspaces-part-2\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/foojay.io\\\/today\\\/how-does-java-handle-different-images-and-colorspaces-part-2\\\/\"},\"author\":{\"name\":\"Mark Stephens\",\"@id\":\"https:\\\/\\\/foojay.io\\\/#\\\/schema\\\/person\\\/750f1f5bc582e0c9728bf8f28e9461b7\"},\"headline\":\"How does Java handle different Images and ColorSpaces \u2013 Part 2\",\"datePublished\":\"2020-06-21T17:11:00+00:00\",\"dateModified\":\"2021-08-23T12:25:20+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/foojay.io\\\/today\\\/how-does-java-handle-different-images-and-colorspaces-part-2\\\/\"},\"wordCount\":276,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\\\/\\\/foojay.io\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/foojay.io\\\/today\\\/how-does-java-handle-different-images-and-colorspaces-part-2\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/blog.idrsolutions.com\\\/wp-content\\\/uploads\\\/2019\\\/11\\\/Screenshot-2019-11-19-at-10.43.30-134x300.png\",\"keywords\":[\"Java\",\"OpenJDK\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/foojay.io\\\/today\\\/how-does-java-handle-different-images-and-colorspaces-part-2\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/foojay.io\\\/today\\\/how-does-java-handle-different-images-and-colorspaces-part-2\\\/\",\"url\":\"https:\\\/\\\/foojay.io\\\/today\\\/how-does-java-handle-different-images-and-colorspaces-part-2\\\/\",\"name\":\"foojay \u2013 a place for friends of OpenJDK\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/foojay.io\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/foojay.io\\\/today\\\/how-does-java-handle-different-images-and-colorspaces-part-2\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/foojay.io\\\/today\\\/how-does-java-handle-different-images-and-colorspaces-part-2\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/blog.idrsolutions.com\\\/wp-content\\\/uploads\\\/2019\\\/11\\\/Screenshot-2019-11-19-at-10.43.30-134x300.png\",\"datePublished\":\"2020-06-21T17:11:00+00:00\",\"dateModified\":\"2021-08-23T12:25:20+00:00\",\"description\":\"foojay is the place for all OpenJDK Update Release Information. Learn More.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/foojay.io\\\/today\\\/how-does-java-handle-different-images-and-colorspaces-part-2\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/foojay.io\\\/today\\\/how-does-java-handle-different-images-and-colorspaces-part-2\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/foojay.io\\\/today\\\/how-does-java-handle-different-images-and-colorspaces-part-2\\\/#primaryimage\",\"url\":\"https:\\\/\\\/blog.idrsolutions.com\\\/wp-content\\\/uploads\\\/2019\\\/11\\\/Screenshot-2019-11-19-at-10.43.30-134x300.png\",\"contentUrl\":\"https:\\\/\\\/blog.idrsolutions.com\\\/wp-content\\\/uploads\\\/2019\\\/11\\\/Screenshot-2019-11-19-at-10.43.30-134x300.png\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/foojay.io\\\/today\\\/how-does-java-handle-different-images-and-colorspaces-part-2\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/foojay.io\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How does Java handle different Images and ColorSpaces \u2013 Part 2\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/foojay.io\\\/#website\",\"url\":\"https:\\\/\\\/foojay.io\\\/\",\"name\":\"foojay\",\"description\":\"a place for friends of OpenJDK\",\"publisher\":{\"@id\":\"https:\\\/\\\/foojay.io\\\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/foojay.io\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/foojay.io\\\/#organization\",\"name\":\"foojay\",\"url\":\"https:\\\/\\\/foojay.io\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/foojay.io\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/foojay.io\\\/wp-content\\\/uploads\\\/2020\\\/04\\\/cropped-Favicon.png\",\"contentUrl\":\"https:\\\/\\\/foojay.io\\\/wp-content\\\/uploads\\\/2020\\\/04\\\/cropped-Favicon.png\",\"width\":512,\"height\":512,\"caption\":\"foojay\"},\"image\":{\"@id\":\"https:\\\/\\\/foojay.io\\\/#\\\/schema\\\/logo\\\/image\\\/\"},\"sameAs\":[\"https:\\\/\\\/x.com\\\/foojay2020\"]},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/foojay.io\\\/#\\\/schema\\\/person\\\/750f1f5bc582e0c9728bf8f28e9461b7\",\"name\":\"Mark Stephens\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/9ac75725e39c6001c43782366fe8c4a255662ed2db3a1582012d9f23ec1f60e6?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/9ac75725e39c6001c43782366fe8c4a255662ed2db3a1582012d9f23ec1f60e6?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/9ac75725e39c6001c43782366fe8c4a255662ed2db3a1582012d9f23ec1f60e6?s=96&d=mm&r=g\",\"caption\":\"Mark Stephens\"},\"description\":\"Entrepreneur and Java software developer, founder and CEO of IDRsolutions\",\"sameAs\":[\"https:\\\/\\\/www.linkedin.com\\\/in\\\/mnstephens\\\/\",\"https:\\\/\\\/x.com\\\/markee174\"],\"url\":\"https:\\\/\\\/foojay.io\\\/today\\\/author\\\/mark-stephens\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"foojay \u2013 a place for friends of OpenJDK","description":"foojay is the place for all OpenJDK Update Release Information. Learn More.","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:\/\/foojay.io\/today\/how-does-java-handle-different-images-and-colorspaces-part-2\/","og_locale":"en_US","og_type":"article","og_title":"foojay \u2013 a place for friends of OpenJDK","og_description":"foojay is the place for all OpenJDK Update Release Information. Learn More.","og_url":"https:\/\/foojay.io\/today\/how-does-java-handle-different-images-and-colorspaces-part-2\/","og_site_name":"foojay","article_published_time":"2020-06-21T17:11:00+00:00","article_modified_time":"2021-08-23T12:25:20+00:00","og_image":[{"url":"https:\/\/blog.idrsolutions.com\/wp-content\/uploads\/2019\/11\/Screenshot-2019-11-19-at-10.43.30-134x300.png","type":"","width":"","height":""}],"author":"Mark Stephens","twitter_misc":{"Written by":"Mark Stephens","Est. reading time":"1 minute"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/foojay.io\/today\/how-does-java-handle-different-images-and-colorspaces-part-2\/#article","isPartOf":{"@id":"https:\/\/foojay.io\/today\/how-does-java-handle-different-images-and-colorspaces-part-2\/"},"author":{"name":"Mark Stephens","@id":"https:\/\/foojay.io\/#\/schema\/person\/750f1f5bc582e0c9728bf8f28e9461b7"},"headline":"How does Java handle different Images and ColorSpaces \u2013 Part 2","datePublished":"2020-06-21T17:11:00+00:00","dateModified":"2021-08-23T12:25:20+00:00","mainEntityOfPage":{"@id":"https:\/\/foojay.io\/today\/how-does-java-handle-different-images-and-colorspaces-part-2\/"},"wordCount":276,"commentCount":0,"publisher":{"@id":"https:\/\/foojay.io\/#organization"},"image":{"@id":"https:\/\/foojay.io\/today\/how-does-java-handle-different-images-and-colorspaces-part-2\/#primaryimage"},"thumbnailUrl":"https:\/\/blog.idrsolutions.com\/wp-content\/uploads\/2019\/11\/Screenshot-2019-11-19-at-10.43.30-134x300.png","keywords":["Java","OpenJDK"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/foojay.io\/today\/how-does-java-handle-different-images-and-colorspaces-part-2\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/foojay.io\/today\/how-does-java-handle-different-images-and-colorspaces-part-2\/","url":"https:\/\/foojay.io\/today\/how-does-java-handle-different-images-and-colorspaces-part-2\/","name":"foojay \u2013 a place for friends of OpenJDK","isPartOf":{"@id":"https:\/\/foojay.io\/#website"},"primaryImageOfPage":{"@id":"https:\/\/foojay.io\/today\/how-does-java-handle-different-images-and-colorspaces-part-2\/#primaryimage"},"image":{"@id":"https:\/\/foojay.io\/today\/how-does-java-handle-different-images-and-colorspaces-part-2\/#primaryimage"},"thumbnailUrl":"https:\/\/blog.idrsolutions.com\/wp-content\/uploads\/2019\/11\/Screenshot-2019-11-19-at-10.43.30-134x300.png","datePublished":"2020-06-21T17:11:00+00:00","dateModified":"2021-08-23T12:25:20+00:00","description":"foojay is the place for all OpenJDK Update Release Information. Learn More.","breadcrumb":{"@id":"https:\/\/foojay.io\/today\/how-does-java-handle-different-images-and-colorspaces-part-2\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/foojay.io\/today\/how-does-java-handle-different-images-and-colorspaces-part-2\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/foojay.io\/today\/how-does-java-handle-different-images-and-colorspaces-part-2\/#primaryimage","url":"https:\/\/blog.idrsolutions.com\/wp-content\/uploads\/2019\/11\/Screenshot-2019-11-19-at-10.43.30-134x300.png","contentUrl":"https:\/\/blog.idrsolutions.com\/wp-content\/uploads\/2019\/11\/Screenshot-2019-11-19-at-10.43.30-134x300.png"},{"@type":"BreadcrumbList","@id":"https:\/\/foojay.io\/today\/how-does-java-handle-different-images-and-colorspaces-part-2\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/foojay.io\/"},{"@type":"ListItem","position":2,"name":"How does Java handle different Images and ColorSpaces \u2013 Part 2"}]},{"@type":"WebSite","@id":"https:\/\/foojay.io\/#website","url":"https:\/\/foojay.io\/","name":"foojay","description":"a place for friends of OpenJDK","publisher":{"@id":"https:\/\/foojay.io\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/foojay.io\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/foojay.io\/#organization","name":"foojay","url":"https:\/\/foojay.io\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/foojay.io\/#\/schema\/logo\/image\/","url":"https:\/\/foojay.io\/wp-content\/uploads\/2020\/04\/cropped-Favicon.png","contentUrl":"https:\/\/foojay.io\/wp-content\/uploads\/2020\/04\/cropped-Favicon.png","width":512,"height":512,"caption":"foojay"},"image":{"@id":"https:\/\/foojay.io\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/x.com\/foojay2020"]},{"@type":"Person","@id":"https:\/\/foojay.io\/#\/schema\/person\/750f1f5bc582e0c9728bf8f28e9461b7","name":"Mark Stephens","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/9ac75725e39c6001c43782366fe8c4a255662ed2db3a1582012d9f23ec1f60e6?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/9ac75725e39c6001c43782366fe8c4a255662ed2db3a1582012d9f23ec1f60e6?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/9ac75725e39c6001c43782366fe8c4a255662ed2db3a1582012d9f23ec1f60e6?s=96&d=mm&r=g","caption":"Mark Stephens"},"description":"Entrepreneur and Java software developer, founder and CEO of IDRsolutions","sameAs":["https:\/\/www.linkedin.com\/in\/mnstephens\/","https:\/\/x.com\/markee174"],"url":"https:\/\/foojay.io\/today\/author\/mark-stephens\/"}]}},"_links":{"self":[{"href":"https:\/\/foojay.io\/wp-json\/wp\/v2\/posts\/32627","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/foojay.io\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/foojay.io\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/foojay.io\/wp-json\/wp\/v2\/users\/40"}],"replies":[{"embeddable":true,"href":"https:\/\/foojay.io\/wp-json\/wp\/v2\/comments?post=32627"}],"version-history":[{"count":0,"href":"https:\/\/foojay.io\/wp-json\/wp\/v2\/posts\/32627\/revisions"}],"wp:attachment":[{"href":"https:\/\/foojay.io\/wp-json\/wp\/v2\/media?parent=32627"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/foojay.io\/wp-json\/wp\/v2\/categories?post=32627"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/foojay.io\/wp-json\/wp\/v2\/tags?post=32627"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}