<div dir="ltr"><div>Hello!</div><div><br></div><div>This might be retreading some ground. I searched the archives and found a short discussion but it was 11 years ago so I'm not sure how much (if anything has changed). If nothing has, feel free to just tell me so!</div><div><br></div><div>I've got code that reads TIFF/JPG/PNGs and carves them into tiles to feed to a viewer. It's been working fine for years, but I'm now being told that I need to handle CMYK (and maybe LAB, though that's a low priority). I've been using the GDALRasterBand::RasterIO to read in pixels by band and that's worked pretty well (I already handle greyscale since that's easy).</div><div><br></div><div>I could do a CMYK transformation but from what I read in that archived thread, I'd probably need to switch to the GDALRasterDataset::RasterIO API instead (not necessarily a bad thing!) so I have enough information to do the rough mathematical conversion. I have zero idea how to use profiles, even if they're present though, so I'm not sure how good it would look.</div><div><br>Before I dive into all that work, I figured it was worth asking if there was something already existing in the API. From searching, it looks like gdal_translate performs such a conversion so in theory the logic is somewhere already. If nothing else, maybe I can crib from it? Ideally there'd be a way for me to say "GDALRasterDataset, please convert to RGB" but that is probably too optimistic. </div><div><br></div><div>Any suggestions or guidance would be greatly appreciated! (even if it's just "Yes, the old post is still correct, go do that").</div><div><br></div><span class="gmail_signature_prefix">-- </span><br><div dir="ltr" class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><table cellspacing="0" cellpadding="0" border="0" width="100%" style="font-family:"Times New Roman";border-collapse:collapse;table-layout:fixed;word-break:break-word"><tbody><tr><td><p></p><table cellspacing="0" cellpadding="0" border="0" style="border-collapse:collapse;table-layout:fixed;word-break:break-word;direction:ltr"><tbody><tr><td style="padding-right:15px;vertical-align:top;font-family:Arial,Helvetica,sans-serif"><table style="border-collapse:collapse;table-layout:fixed;word-break:break-word;direction:ltr"><tbody><tr><td style="height:160px"><a><img src="https://assets.avenza.com/Avenza_UC_2023/Avenza_Sytems_Logo_Email_Signature_w4MganGMc.png" alt="Avenza Systems Logo" width="101" height="101" border="0" style="display:block;border:0px;border-radius:0px"></a></td></tr></tbody></table></td><td style="vertical-align:top;font-family:Arial,Helvetica,sans-serif;border-left:1px solid rgb(146,146,146);padding-left:10px"><table cellspacing="0" cellpadding="0" border="0" width="100%" style="border-collapse:collapse;table-layout:fixed;word-break:break-word;direction:ltr"><tbody><tr></tr><tr><td style="color:rgb(146,146,146);font-size:14.2px;font-weight:bold;line-height:18px;padding-bottom:5px"><span style="color:rgb(56,56,52);font-size:14.3px;line-height:18px">Andrew Patterson</span></td></tr><tr><td style="color:rgb(56,56,52);font-size:13.3px;font-family:Inter,sans-serif;font-weight:bold;line-height:18px;padding-bottom:5px">Lead Software Architect</td></tr><tr><td style="color:rgb(146,146,146);font-size:13.2px;font-family:Inter,sans-serif;line-height:18px;padding-bottom:5px">+1 (416) 487-5116 x401   <br>84 Merton St., Toronto, ON, M4S 1A1</td></tr><tr><td style="color:rgb(0,0,0);font-size:13px;font-family:Inter,sans-serif;line-height:6px;padding-bottom:10px"> <p style="color:red">///<a href="https://www.avenza.com/about/contact/" target="_blank">supply.founders.outreach</a></p></td></tr><tr><td style="padding-top:7.5px"><a href="https://www.facebook.com/AvenzaSystems/" style="border:0px;display:inline-block" target="_blank"><img width="23" height="23" src="https://assets.avenza.com/Email_Signatures/FB-25x25_A7fZlH7-K.png?updatedAt=1684430272556" style="border-radius:4px;display:block;border:none;width:23px;height:23px;max-width:23px!important;max-height:23px!important"></a>   <a href="https://x.com/Avenza" style="border:0px;display:inline-block" target="_blank"><img width="23" height="23" src="https://assets.avenza.com/Email_Signatures/Twitter-25x25_kg1vrO2Ke.png?updatedAt=1692372369538" style="border-radius:4px;display:block;border:none;width:23px;height:23px;max-width:23px!important;max-height:23px!important"></a>   <a href="https://www.linkedin.com/company/avenza-systems-inc-/mycompany/" style="border:0px;display:inline-block" target="_blank"><img width="23" height="23" src="https://assets.avenza.com/Email_Signatures/LinkedIn-25x25_3fylQWPIxn.png?updatedAt=1684430272623" style="border-radius:4px;display:block;border:none;width:23px;height:23px;max-width:23px!important;max-height:23px!important"></a>   <a href="https://www.instagram.com/avenzamaps/" style="border:0px;display:inline-block" target="_blank"><img width="23" height="23" src="https://assets.avenza.com/Email_Signatures/Instagram-25x25_AM1_bfO1avKzy.png?updatedAt=1684512568472" style="border-radius:4px;display:block;border:none;width:23px;height:23px;max-width:23px!important;max-height:23px!important"></a>   <a href="https://x.com/AvenzaMaps" style="border:0px;display:inline-block" target="_blank"><img width="23" height="23" src="https://assets.avenza.com/Email_Signatures/Twitter-25x25_AM1_7eJfawp-U.png?updatedAt=1692372280452" style="border-radius:4px;display:block;border:none;width:23px;height:23px;max-width:23px!important;max-height:23px!important"></a>   <a href="https://www.facebook.com/AvenzaMaps/" style="border:0px;display:inline-block" target="_blank"><img width="23" height="23" src="https://assets.avenza.com/Email_Signatures/FB-25x25_AM1_BDAFepyU1.png?updatedAt=1684512412688" style="border-radius:4px;display:block;border:none;width:23px;height:23px;max-width:23px!important;max-height:23px!important"></a>  </td></tr></tbody></table></td></tr><tr style="width:370px"><td colspan="3" style="padding-top:10px"><a href="https://www.avenza.com/resources/events/" target="_blank"><img src="https://assets.avenza.com/Email_Signatures/AvenzaBanner_6sOJTZbUQ.png?updatedAt=1684511884121" alt="Avenza Events Banner" border="0" style="max-width:370px;height:auto;border:0px"></a></td></tr></tbody></table></td></tr></tbody></table></div></div></div>