{"id":32629,"date":"2020-06-23T17:20:00","date_gmt":"2020-06-23T17:20:00","guid":{"rendered":"https:\/\/foojay.io\/?p=32629"},"modified":"2021-08-23T12:53:08","modified_gmt":"2021-08-23T12:53:08","slug":"how-does-java-handle-different-images-and-colorspaces-part-4","status":"publish","type":"post","link":"https:\/\/foojay.io\/today\/how-does-java-handle-different-images-and-colorspaces-part-4\/","title":{"rendered":"How does Java handle different Images and ColorSpaces \u2013 Part 4"},"content":{"rendered":"\n    <div class=\"article__table\">\n        <div class=\"article__table-header\">\n            <svg width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"none\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\">\n                <path d=\"M8 6H21\" stroke=\"#3562E5\" stroke-width=\"1.5\" stroke-linecap=\"round\" stroke-linejoin=\"round\" \/>\n                <path d=\"M8 12H21\" stroke=\"#3562E5\" stroke-width=\"1.5\" stroke-linecap=\"round\" stroke-linejoin=\"round\" \/>\n                <path d=\"M8 18H21\" stroke=\"#3562E5\" stroke-width=\"1.5\" stroke-linecap=\"round\" stroke-linejoin=\"round\" \/>\n                <path d=\"M3 6H3.01\" stroke=\"#3562E5\" stroke-width=\"1.5\" stroke-linecap=\"round\" stroke-linejoin=\"round\" \/>\n                <path d=\"M3 12H3.01\" stroke=\"#3562E5\" stroke-width=\"1.5\" stroke-linecap=\"round\" stroke-linejoin=\"round\" \/>\n                <path d=\"M3 18H3.01\" stroke=\"#3562E5\" stroke-width=\"1.5\" stroke-linecap=\"round\" stroke-linejoin=\"round\" \/>\n            <\/svg>\n            Table of Contents\n            <svg class=\"chevron\" width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"none\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\">\n                <path d=\"M18 15L12 9L6 15\" stroke=\"#3562E5\" stroke-width=\"1.5\" stroke-linecap=\"round\" stroke-linejoin=\"round\"\/>\n            <\/svg>\n        <\/div>\n        <div class=\"article__table-body\"><ul><li><a href=\"#h3-0-1-ould-have-better-support-for-some-image-file-formats-\">1. Could have better support for some image file formats.<\/a><\/li><li><a href=\"#h3-1-2-oes-not-support-mage-file-formats\">2. Does not support Image file formats<\/a><\/li><li><a href=\"#h3-2-3-emory-issues-and-ugs\">3. Memory issues and Bugs<\/a><\/li><\/ul><span><a href=\"#h2-3--lternatives-\">Alternatives?<\/a><\/span><ul><li><a href=\"#h3-4--hy-use-pache-maging-ibrary-\">Why use Apache Imaging Library?<\/a><\/li><\/ul><\/div><\/div><!DOCTYPE html PUBLIC \"-\/\/W3C\/\/DTD HTML 4.0 Transitional\/\/EN\" \"http:\/\/www.w3.org\/TR\/REC-html40\/loose.dtd\">\n<?xml encoding=\"utf-8\" ?><html><body><p>Unless you are creating all your images, by drawing then inside the code with the Graphics2D commands, you will need an image library to load images as BufferedImages. You will also need an Image library if you wish to save the results.<\/p>\n\n\n<p>ImageIO is part of Java, it is free and it supports a range of Image formats including GIF, JPEG, PNG, and TIF. Because it is expandable, there are additional libraries to extend it. We recommend you check out the excellent&nbsp;<a target=\"_blank\" href=\"https:\/\/github.com\/haraldk\/TwelveMonkeys\">TwelveMonkeys image library<\/a>&nbsp;which is free and Open Source.<\/p>\n\n\n<p>ImageIO does have some limitations which can be summed up as:-<\/p>\n\n\n<h3 class=\"wp-block-heading\" id=\"h3-0-1-ould-have-better-support-for-some-image-file-formats-\">1. Could have better support for some image file formats.<\/h3>\n\n\n<p>JPEG\/JPEG2000 support in ImageIO is not as good as it could be and the main reason we started writing our own Image library.<\/p>\n\n\n<h3 class=\"wp-block-heading\" id=\"h3-1-2-oes-not-support-mage-file-formats\">2. Does not support Image file formats<\/h3>\n\n\n<p>There are lots of image formats which ImageIO will not read and write.<\/p>\n\n\n<h3 class=\"wp-block-heading\" id=\"h3-2-3-emory-issues-and-ugs\">3. Memory issues and Bugs<\/h3>\n\n\n<p>ImageIO uses native memory so it runs out of memory even if there is lots of Java heap. This can be a big issue with server software being shared between multiple users.<\/p>\n\n\n<h2 class=\"wp-block-heading\" id=\"h2-3--lternatives-\">Alternatives?<\/h2>\n\n\n<p>Luckily there are options. Below we give you some reasons to use the excellent Open Source Apache Imaging library or own commercial JDeli image library. We think they provide the two best options if you need something more than ImageIO. Which one is best will depend on your exact requirements.<\/p>\n\n\n<h3 class=\"wp-block-heading\" id=\"h3-4--hy-use-pache-maging-ibrary-\">Why use Apache Imaging Library?<\/h3>\n\n\n<ul class=\"wp-block-list\"><li>Free and Open source<\/li><li>prevents heap related JVM crashes<\/li><li>Very wide range of&nbsp;<a target=\"_blank\" href=\"https:\/\/commons.apache.org\/proper\/commons-imaging\/formatsupport.html\">image formats<\/a>&nbsp;(but not JPEG2000)<\/li><li>implements unsupported image formats in ImageIO<\/li><li>reduced output file size over ImageIO<\/li><li>Source code under Apache license.<\/li><\/ul>\n\n\n<p>Visit the&nbsp;<a target=\"_blank\" href=\"http:\/\/commons.apache.org\/proper\/commons-imaging\/\">Apache Commons Imaging library<\/a><\/p>\n<\/body><\/html>\n","protected":false},"excerpt":{"rendered":"<p>Unless you are creating all your images, by drawing then inside the code with the Graphics2D commands, you will need an image library to load images as BufferedImages. You will also need an Image library if you wish to save the results.<\/p>\n<p>ImageIO is part of Java, it is free and it supports a range of Image formats including GIF, JPEG, PNG, and TIF. Because it is expandable, there are additional libraries to extend it.<\/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":[],"class_list":["post-32629","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"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-4\/\" \/>\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-4\/\" \/>\n<meta property=\"og:site_name\" content=\"foojay\" \/>\n<meta property=\"article:published_time\" content=\"2020-06-23T17:20:00+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2021-08-23T12:53:08+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/foojay.io\/wp-content\/uploads\/2020\/04\/Favicon-3-2.png\" \/>\n\t<meta property=\"og:image:width\" content=\"384\" \/>\n\t<meta property=\"og:image:height\" content=\"384\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/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-4\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/foojay.io\\\/today\\\/how-does-java-handle-different-images-and-colorspaces-part-4\\\/\"},\"author\":{\"name\":\"Mark Stephens\",\"@id\":\"https:\\\/\\\/foojay.io\\\/#\\\/schema\\\/person\\\/750f1f5bc582e0c9728bf8f28e9461b7\"},\"headline\":\"How does Java handle different Images and ColorSpaces \u2013 Part 4\",\"datePublished\":\"2020-06-23T17:20:00+00:00\",\"dateModified\":\"2021-08-23T12:53:08+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/foojay.io\\\/today\\\/how-does-java-handle-different-images-and-colorspaces-part-4\\\/\"},\"wordCount\":303,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\\\/\\\/foojay.io\\\/#organization\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/foojay.io\\\/today\\\/how-does-java-handle-different-images-and-colorspaces-part-4\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/foojay.io\\\/today\\\/how-does-java-handle-different-images-and-colorspaces-part-4\\\/\",\"url\":\"https:\\\/\\\/foojay.io\\\/today\\\/how-does-java-handle-different-images-and-colorspaces-part-4\\\/\",\"name\":\"foojay \u2013 a place for friends of OpenJDK\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/foojay.io\\\/#website\"},\"datePublished\":\"2020-06-23T17:20:00+00:00\",\"dateModified\":\"2021-08-23T12:53:08+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-4\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/foojay.io\\\/today\\\/how-does-java-handle-different-images-and-colorspaces-part-4\\\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/foojay.io\\\/today\\\/how-does-java-handle-different-images-and-colorspaces-part-4\\\/#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 4\"}]},{\"@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-4\/","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-4\/","og_site_name":"foojay","article_published_time":"2020-06-23T17:20:00+00:00","article_modified_time":"2021-08-23T12:53:08+00:00","og_image":[{"width":384,"height":384,"url":"https:\/\/foojay.io\/wp-content\/uploads\/2020\/04\/Favicon-3-2.png","type":"image\/png"}],"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-4\/#article","isPartOf":{"@id":"https:\/\/foojay.io\/today\/how-does-java-handle-different-images-and-colorspaces-part-4\/"},"author":{"name":"Mark Stephens","@id":"https:\/\/foojay.io\/#\/schema\/person\/750f1f5bc582e0c9728bf8f28e9461b7"},"headline":"How does Java handle different Images and ColorSpaces \u2013 Part 4","datePublished":"2020-06-23T17:20:00+00:00","dateModified":"2021-08-23T12:53:08+00:00","mainEntityOfPage":{"@id":"https:\/\/foojay.io\/today\/how-does-java-handle-different-images-and-colorspaces-part-4\/"},"wordCount":303,"commentCount":0,"publisher":{"@id":"https:\/\/foojay.io\/#organization"},"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/foojay.io\/today\/how-does-java-handle-different-images-and-colorspaces-part-4\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/foojay.io\/today\/how-does-java-handle-different-images-and-colorspaces-part-4\/","url":"https:\/\/foojay.io\/today\/how-does-java-handle-different-images-and-colorspaces-part-4\/","name":"foojay \u2013 a place for friends of OpenJDK","isPartOf":{"@id":"https:\/\/foojay.io\/#website"},"datePublished":"2020-06-23T17:20:00+00:00","dateModified":"2021-08-23T12:53:08+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-4\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/foojay.io\/today\/how-does-java-handle-different-images-and-colorspaces-part-4\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/foojay.io\/today\/how-does-java-handle-different-images-and-colorspaces-part-4\/#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 4"}]},{"@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\/32629","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=32629"}],"version-history":[{"count":0,"href":"https:\/\/foojay.io\/wp-json\/wp\/v2\/posts\/32629\/revisions"}],"wp:attachment":[{"href":"https:\/\/foojay.io\/wp-json\/wp\/v2\/media?parent=32629"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/foojay.io\/wp-json\/wp\/v2\/categories?post=32629"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/foojay.io\/wp-json\/wp\/v2\/tags?post=32629"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}