# Issue with Alpha channel and PNG image

**URL:** <https://forum.juce.com/t/issue-with-alpha-channel-and-png-image/45289>\
**Category:** General JUCE discussion\
**Created:** [March 30, 2021, 9:16am UTC](https://forum.juce.com/t/issue-with-alpha-channel-and-png-image/45289 "2021-03-30T09:16:34Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![jakob-2](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/jakob-2/32/783_2.png) [@jakob-2](https://forum.juce.com/u/jakob-2)\
**Post date:** [March 30, 2021, 9:16am UTC](https://forum.juce.com/t/issue-with-alpha-channel-and-png-image/45289/1 "2021-03-30T09:16:34Z")

</div>

Hey there, we’re loading a non-transparent PNG image via `auto image = juce::ImageCache::getFromMemory(..)`.

On Windows, `image.hasAlphaChannel()` returns `true`, on macOS it returns `false`. Which is obviously strange… is this a known issue?

---

<div class="post-metadata">

**Author:** ![Mrugalla](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/mrugalla/32/13092_2.png) [@Mrugalla](https://forum.juce.com/u/Mrugalla)\
**Post date:** [March 30, 2021, 6:10pm UTC](https://forum.juce.com/t/issue-with-alpha-channel-and-png-image/45289/2 "2021-03-30T18:10:02Z")

</div>

idk if this is a known issue but if you want to make sure that the image is loaded to something that has no alpha channel you could create an image object beforehand with the correct bounds and use juce::Image::RGB as the first argument of it, then copy over all the pixels from your binary data’s image

---

<div class="post-metadata">

**Author:** ![oli1](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/oli1/32/15664_2.png) [@oli1](https://forum.juce.com/u/oli1)\
**Post date:** [July 29, 2024, 3:16pm UTC](https://forum.juce.com/t/issue-with-alpha-channel-and-png-image/45289/3 "2024-07-29T15:16:31Z")

</div>

‘Image’ types are backed by CoreGraphics on Apple platforms which don’t support 24bit types, so they’re convert them to RGBA when created. This is where the alpha channel comes from.

We’re currently implementing the ability to override this behavour.
