• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
Locked
0

Is it possible to save PNG with transparency to Camera Roll?

Engaged ,
Mar 29, 2013 Mar 29, 2013

Copy link to clipboard

Copied

I've had a user contact me saying that the pictures he creates save as JPG and because they are JPG they lose transparency. I looked at the code I'm using and it's CameraRoll.addBitmapData(bitmapData). I could find no other options or parameters. He also said it is highly compressed JPG as well. If it's not supported (although I thought it was in an earlier version??) is there a work around!?

TOPICS
Air beta

Views

10.3K

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
Apr 09, 2013 Apr 09, 2013

Copy link to clipboard

Copied

Bump. How come it's so horribly compressed? If we are stuck with JPG can we use JPEG 2000 with lossless and transparency? Otherwise please allow adding content of PNG origin. 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Employee ,
Apr 18, 2013 Apr 18, 2013

Copy link to clipboard

Copied

Thanks for your bug report. The bug is already been logged at https://bugbase.adobe.com/index.cfm?event=bug&id=3205096 , please add your vote and comment.

Regards,

Nimit

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
May 01, 2013 May 01, 2013

Copy link to clipboard

Copied

I would not implement this, or do so with a big disclaimer.  Images with transparency in the cameraroll cause iOS bugs (https://discussions.apple.com/thread/3778274?start=0&tstart=0) and people will blame AIR.  It's an iOS problem, but it doesn't matter - it will look like AIR or our apps that are causing problems.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
May 01, 2013 May 01, 2013

Copy link to clipboard

Copied

Thanks Jeff. I get what you're saying but I'm not going to limit my software because other software has bugs. Adding the feature and showing a disclaimer is a much better option in my opinion than not supporting this feature. BTW I'm using native capture in Android and iOS. Users won't know it's AIR.

FYI The AIR camera roll also has a similar issue as the one you referenced. The problem is, I think, that AIR doesn't refresh the directory after adding an image to it. I say this because there is an ANE that refreshes the camera roll that creates the thumbnail and updates the cache.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
May 02, 2013 May 02, 2013

Copy link to clipboard

Copied

We were writing a native Object-C app (not AIR) and wanted to save semi-transparent GIFs and PNGs, and we simply couldn't do this, because there's an iOS bug with semi-transparent images in the CameraRoll.

So all I'm saying is, if AIR adds semi-transparent image saving to camera roll, it may not pass review, your users will report bugs with your app, then you'll come back and report bugs against AIR, and it'll be a big headache for everyone.

While I agree that it'd be nice if CameraRoll.addBitmapData supported encoding parameters (quality, format, etc), it would cause headaches to provide transparency support before the bug is fixed in iOS.

So you need to avoid iOS CameraRoll with transparency?  Want high JPEG quality?  Easy - encode the BitmapData in code and upload the resultant ByteArray to a service (imgur, tumblr, flickr) or your own custom server.  You can also potentially (with an ANE?) email the image (ByteArray) as an attachment.  You just can't (safely) save a semi-transparent image to the CameraRoll on iOS.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
May 25, 2013 May 25, 2013

Copy link to clipboard

Copied

I have to disagree  that  exporting transparent PNGs is a bad thing to do just because apps on iOS like Photo Album don't properly render images nicely with transparency.

Other apps totally do, and you can easily still use Mail to mail these transparent pngs to other apps or share them to other share services and the transparency comes along fine.

I had also previously reported this as a bug, and also posted all the code you would need in an ANE to make it happen.

https://bugbase.adobe.com/index.cfm?event=bug&id=3205096

Additionally someone has already wrapped this up in an ANE as well.

https://github.com/katopz/ane-photosalbum

I have one existing iOS app in the store that exports creative output in the app as transparent PNGs (with another on the way) and have had many users thank us for this feature, as it is extremely useful for designers etc..

It works great.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
May 29, 2013 May 29, 2013

Copy link to clipboard

Copied

Jeff A - I agree that it's a good feature, and agree with you technically.  But since it's a power-user feature and there are existing workarounds, I'd prefer to see the (presumably skeleton) AIR team work on more important things (mobile threads/workers) than the bug reports this would cause.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
May 29, 2013 May 29, 2013

Copy link to clipboard

Copied

I hear you, and I agree there are more important features to work on (especially since it is easy to just use a third-party ANE today to solve the problem if you want). I think more and more features are going to maybe only see the light of day in ANEs anyway.

I just think it is worth logging the limitation for Adobe to possibly fix at some point.

I do think it is a little embarrasing that Adobe provides only JPEG exporting to developers in AIR, when they themselves are working with and pushing around PNG (and I think even transparent PNG support) in their own mobile apps and creative suites.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Nov 15, 2013 Nov 15, 2013

Copy link to clipboard

Copied

Hi everyone, is there a way of saving a retina resolution (144px) image using camera Roll on iPad? I'm a novice coder, so I hope there is an easy way. I'm not able to use command line etc..

Please post any code here, or if not, does anyone know if Flash CC has fixed this?

Thanks,

Matt

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Contributor ,
Mar 11, 2014 Mar 11, 2014

Copy link to clipboard

Copied

Anyone know an ANE where I can do this but for Android?  Sucks that this capability is limited due to an iOS issue.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
Mar 11, 2014 Mar 11, 2014

Copy link to clipboard

Copied

It isn't really limited due to an iOS issue, just that Adobe chooses to not add PNG with transparency support. I completely disagree with the premise that this should be limited just because on iOS  Photo Album doesn't display PNGs with transparency accurately. There are dozens of existing iOS apps now passing around and creating PNGs with transparency (and viewing them properly).

As far as Android, I implemented this myself just using the builtin BitmapData.encode support for creating PNG format ByteArray, and just saving directly to the filesystem a .png file since Android (unlike iOS) allows it.

To make that process  clean with the rest of the Android eco-system, you will probably want to include two additional ANE based features (or choose to roll your own ANE that combines everything)...

The two extra steps as far as ANE support is:

1) an ANE that will trigger a refresh of the Android Gallery (or some base directory more exactly) when the filesystem underneath it has changed if you write to the filesystem directly, there are a few ANEs that do this out there like:

http://forums.adobe.com/message/6092838

2) In newer versions of Android, different users get different mapped 'home dirs' for Pictures so you really don't want to just write to some common /mnt/sdcard folder and hope for the best.

The proper base directory to save Pictures to on Android with the newer APIs is to call (on the native Java side):

File path = Environment.getExternalStoragePublicDirectory( Environment.DIRECTORY_PICTURES);

Just wrapping that returned directory location above from Java with an ANE, will guarantee you are always working with the proper base directory for the current runtime user in Android.

I don't know if any ANE out there has added that 'Public Pictures Directory' function above but it is a trivial function call, and you could even just tack this on as an additional API function on whatever RefreshGallery ANE you grab (with source code of course)

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Apr 14, 2014 Apr 14, 2014

Copy link to clipboard

Copied

Sorry to dig  this thread out, I am facing the poor quality issue mentioned by thx1138 when using CameraRoll.addBitmapData()under Android though. The quality is awfull, and images are unusable.

Do you know if there is an ANE like Katopz one https://github.com/katopz/ane-photosalbum but for Android ?

This would save my arse

Thanks guys !

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Apr 14, 2014 Apr 14, 2014

Copy link to clipboard

Copied

LATEST

I also haven't found an easy to use Png saver for ios and android.. but thanks for your link. I'll check that out.

My friend sent me this huge list of Air Anes, so maybe there's something on here:

http://www.riaxe.com/blog/200-adobe-air-anes/

Matt

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines