Ted Patrick > { Events & Community } > Adobe Systems


Reading the comments on my blog post on CURL BenchMarketing I might be very wrong about the market need for native image encoding. I would like to better understand the need for this as a feature and gather feedback from the community.

Image Encoding Feature Request

Encode a BitmapData Object to PNG, JPG ByteArray with a native API.

Example:

import flash.image.JPEG;
import flash.image.PNG32;

myJPG:ByteArray = new JPEG( bitmapData , 300, 300, 80 );

myPNG:ByteArray = new PNG32( bitmapData , 1500, 1260 );



Formats: PNG, JPG

Focus in order of importance:
- Performance of the translation
- Quality of the Encoding to PNG, JPG Standards

As Flash Player 10 supports writing data to the local machine, Image encoding may become a bottleneck feature for many customers. As data no longer needs to traverse the network for security purposes, it makes sense to allow easy creation of native image formats in Flash Player and AIR.

If you would like to see a feature like this implemented within Flash Player, please post your name, company, and thoughts in the comments below.

Cheers,

Ted :)

46 Responses to “ Native Image Encoding API's - BitmapData to ByteArray (PNG,JPG) ”

  1. # Anonymous Tim

    Hi Ted,
    I use image encoding on a regular basis for various reasons (using the existing open source jpg and png encoders). I definitely think it would be a valuable addition for many companies, if there were significant performance improvements by adding it in as part of the player apis.

    Tim McLeod
    timmcleod.com  

  2. # Anonymous Jordi Romkema

    It would be awesome if Flash Player 10 could get a native PNG & JPEG encoder. Currently we have an application for Nickelodeon where kids can create their own Spongebob cartoon. The data of the cartoon is saved as XML but a screenshot of the cartoon is also made. Right now this is a really small thumbnail, although sufficient enough for the moment. We send the bitmapdata as an array per pixel to our server and PHP recreates the JPEG file pixel by pixel. The most intensive part is the gathering of bitmapdata in Flash and creating an array of the bitmapdata.

    Would be great if we could just send the bitmapdata to a native JPEG encoder and immediately upload the jpeg file to one of our servers.

    Great blog btw ;)

    Jordi Romkema
    Developer & Designer Digital Media
    MTV Networks  

  3. # Anonymous Aran

    I've had to save images on a few projects now, so if you think that a native image API is possible in the dev cycle for F10, then I'd be for it.

    Cheers,
    Aran Rhee
    Design Mr. Rhee  

  4. # Blogger Luca B

    I think image support would be good, but I believe that other stuffs such as OpenGL and shading exposition directly to Flash programmers would be great.

    I don't mean an additional layer (eg. Papervision or Hydra) which has to be supported during hardware evolutions, just OpenGL in a fashion similar to JOGL (https://jogl.dev.java.net/)

    We develop HPC algorithms and the capability of using them on a clent in a Web application would be very appreciated


    Luca Bianchi
    vision.unipv.it
    University of Pavia, Italy  

  5. # Anonymous Anonymous

    Same as other posters. We had a need to encode images in at least 4 different projects in the past year.

    Louis-Philippe Maurice
    NDi Media  

  6. # Blogger Chad U

    I have used JPG/PNG encoding on several projects in the last year... I have been using ImageSnapshot and the ASCorelib methods, but indeed if it was a native part of the API, that would be great. Is it too much to ask to get PDF encoding too? That would be great. I could see making PDFs similiar to how the old printjob stuff was handled... multipage, everything.

    I know, it's a strecth, but hey, ALivePDF does it, right? http://alivepdf.bytearray.org/  

  7. # Anonymous Mitch

    Having native JPEG encoding would be terrific for SlideRocket. SlideRocket is updates thumbnails when you edit a slide and I've had to limit the size of that thumbnail due to performance concerns of the JPEG encoding.

    The lack of multi-threading or at least some sort of background tasking impacts this as well. Or it'd be nice to be able to run AS3 serverside :-)

    mitch  

  8. # Blogger AndyEd

    Indeed, PNG encoding is a significant bottleneck for large web page screenshots in AIR.

    We need this for StomperNet's vision simulation in a browser, http://about.stompernet.com/scrutinizer/

    Future extensions to do more logging and visualization rely on having disk based preservation of pages at the time of experience.  

  9. # Blogger Dusty

    Hey Ted,
    Over here at Panasonic, we'd love to have dynamic loading of SVG. Degrafa is working on some of that stuff, but it seems that loading standards-based vector graphics into a plugin that was created specifically for vector graphics is a feature that should have been implemented long ago.

    As it is right now, I have to compile a library with all of our svg assets into it, which means a recompile every time a new technical drawing is created. I end up compiling monday/wed/friday, just to add in the new graphics, and that swf is getting HUGE.

    For reference, we're doing an internal (curl, take note: corporate) app that allows our instructors to have access to all of our technical drawings, photographs, relationship diagrams, and animated signal flows. We had been using Swift3D for 3D-spin-around of our hardware parts, but with the advent of Papervision3D, we are planning on switching to true 3D interactions.  

  10. # Anonymous Tink

    @ Jordi

    "We send the bitmapdata as an array per pixel to our server and PHP recreates the JPEG file pixel by pixel. The most intensive part is the gathering of bitmapdata in Flash and creating an array of the bitmapdata."

    You'd be much better off sending a ByteArray to the server which you can get using BitmapData.getPixels().

    You can also use

    com.adobe.images.JPGEncoder
    com.adobe.images.PNGEncoder

    found at http://code.google.com/p/as3corelib/source/browse  

  11. # Anonymous Jordi Romkema

    While we're requesting new features anyway I would love to see a PDF decoder too. We have lots of coloring pages for kids supplied by third party companies as PDF file but getting kids to install Acrobat Reader is much harder than installing the Flash Player for obvious reasons.

    I would like to be able to dynamically load the PDF files on the server, display them within Flash and let the kids be able to print them straight from the flash application without ever having to touch the PDF. Would make life so much easier :)  

  12. # Anonymous ethan

    PNG & JPEG encoder would be huge. My company has an Flash elearning course desktop development tool and this would allow us to give our users more tools to process loaded imagery without forcing them to open up a graphics editor. Many of our corporate clients do not have these tools installed and getting IT to add them is a pain.  

  13. # Blogger Darrin Massena

    We currently rely on our server to JPG/PNG encode images. That's fine when the destination is somewhere on the internet but means the user has to wait for the compressed image to be downloaded when saving locally. People do a lot of saving locally!

    This is an especially bad problem for an AIR app that can't rely on a server for compression.

    If we had high-speed image compression we'd also use it to reduce the memory footprint of our Flash application, e.g. by compressing images we keep around for undo, thumbnails, etc. For best UX ideally the image compression would be non-blocking (callback when complete) and not disrupt the Flash UI.

    And we'd use it to dynamically preview what a compressed image would look like and what the file size would be at user selected compression settings.

    The more I think the more applications come to mind.

    Darrin Massena
    Picnik  

  14. # Blogger Mark

    Hi Ted,

    Native PNG, JPEG encoding would be great! I've used the ASCoreLib on several projects. Any kind of content creation tool using Flex/Flash (like SproutBuilder, SliderRocket etc...) could certainly benefit from this. Hope this makes it into the roadmap!

    Mark Johnson
    PorltandStudios.com  

  15. # Anonymous jared

    I think Native support for PNG, JPEG and GIF would be extremely useful. Although, I wouldn't care so much if we had an effective way of spawning a thread to do the heaving lifting. Having to break apart long processes such as image encoding or other complex calculations has been one of the few things that have made me look at JavaFX. At Photobucket we could save a lot of server resources encoding on the client (Everything adds up when you consider millions of uploads a day).  

  16. # Blogger Ria Flex

    I'm working on an online business card designer and part of the application is generating a PNG with the final layout. Native support would greatly increase the performance.  

  17. # Anonymous Anonymous

    YES, please :) ... I see numerous opertunities where such a player native encoding API would be a wunderfull addition.

    For example in the CMS I am building at the moment it would be very usefull. For example, users could see in realtime what the effect of changing the compression slider will have on the image they are going to upload.

    (btw, it would also be great to be able natively encode webcam/mic audio/video streams)  

  18. # Blogger Arnoud

    Hi Ted,

    Adding native image encoding would be awesome.
    It has more value than just creative apps. Think out of the box and more uses become clear.

    for example suppose we have a ria in beta stage.
    The app allowes for bug reporting via a button.
    Clicking on it shows a simple form and also the option to attach a screen dump of the current state of the RIA as a jpeg to illustrate the bug. It would be nice if this could work without having to wait long for image encoding...


    Arnoud Bos
    Artim interactive
    www.artim-interactive.nl  

  19. # Blogger Kenneth

    We tend to do JPEG encoding of image data collected from video frames. Having more efficient encoding would help alot instead of having to do an encode that is broken across frames.

    Kenny Bunch
    Dreamsocket  

  20. # Blogger Piergiorgio Niero

    I think jpg or png encoder isn't a priority for player 10. A better access to bitmapdatas instead can be a real boost for many projects, expecially among 3d projects. Due to slow bitmapdata access nowadays 3d flash engines are using skewing instead of rendering! As Luca Bianchi was saying some comment before, an opengl support would be great, but if it's not possible i'd focus adobe's efforts to make bitmapdatas access faster!

    bye from Italy,
    Piergiorgio Niero  

  21. # Anonymous Anonymous

    Hi Ted,

    It's very very useful for Native support, if you use current AS3 version JPGEncoder to encode a 1024*768 or bigger image, you'll know the pain, it's two slow, almost 1000ms on my machine. And you know AS3 has no multi-thread, so 1000ms block is a huge problem.

    Also i hope PNG Native encoder will support 8-bit indexed color, A pure AS3 encoder also have cpu speed bottleneck, as my AsPngEncoder.

    iiley Chen
    aswing.org  

  22. # Anonymous Patrick

    What a question, of course it would be fantastic. Isn't Adobe working on an online Photoshop? Current methods of encoding JPGs are quite processor intensive and may even freeze the player, also in AS3. Please implement! It would be a big plus for creative online apps as for example http://www.redbull.com/flightlab

    Patrick Juchli
    Less Rain  

  23. # Anonymous efish

    Why not request the GIF encoder?
    Native encoder is good, but keep the flash player slim is more important!  

  24. # Anonymous efish

    Why not request the GIF encoder?
    MP3 encoder is desirable!
    More native coders are good, but keep the flash player slim is more important.  

  25. # Anonymous Anonymous

    Yeah, Have to agree with many other posters. I spent a long time on a major imaging application that required images to be manipulated to andf then encoded as JPGS. The implemented solution was far from ideal and Image encoding would have saved a lot of headaches. Thanks  

  26. # Anonymous David Kennedy

    We use the PNGEncoder from as3corelib on bitstrips.com without any problems, speed isn't an issue. What would be the most useful is an optimized png compression routine - at the moment we run all our output through optipng on the server once pngs are uploaded before dumping them to the disk. It'd be great to get the client to do the heavy lifting before sending it over the wire.  

  27. # Blogger Maxim Porges

    Native image encoding just seems like a natural fit for the Flash platform.

    I work with a developer who is working on a photo processing application, and he is currently having to do all his image processing on a JEE server. While this is pretty easy to do with remoting, it would obviously be great to be able to do it from the Flash client too.

    - max  

  28. # Blogger Ria Flex

    I noticed that Photoshop has DICOM support. It would be great if you could support that in Flash/Flex as well. RIA in hospitals really makes sense!  

  29. # Anonymous Anonymous

    Seems many peolple want many different encoders (jpg/png/gif/mp3/mpeg/flv/...). Would it be an option to make those on de mand plugable? If possible this would mean max flexibility while keeping the player small.

    For many appliacations I think it wouldn't be a problem to download an extra encoder plugin when needed (for example in a CMS or Photo app).

    Maybe Adobe should just provide the basic encoders and open up such a plug in API to third parties which then could provide alternative and additional codecs?  

  30. # Anonymous Andrew Powell

    We recently had the folks at CURL pitch us their platform. They spent most of the time bashing Silverlight and Flash. They also said something to the effect of "We're huge in Japan."

    My favorite part though was when they claimed that Silverlight was late to the RIA party. Are you serious? Hello? Pot, meet kettle.

    Although they may have market share in Japan, they are definitely behind the 8 ball when it comes to breaking past both Silverlight and Flash Player.  

  31. # Blogger Thibaud

    You certainly have my vote for a native png & jpeg encoder.
    AIR application playground would definitely expand with it.  

  32. # Anonymous Anonymous

    It's really needed. I've asked for this in the Adobe Air forum, as it took around 5 seconds to compress a screenshot 1600x1200. The AS3 compression is a blocking operation, and 5 seconds is a long time to wait for a user, without getting any kind of notification or progress update. You can however process the image in small chunks with increased overhead and complexity, but a native encoder would do the same job in less than 100ms.  

  33. # Anonymous Dave W

    Hi Ted,

    Please don't rule out the potential for native flv video encoding too.

    I have an application called BuddyPoke on myspace, hi5 and Orkut. It's a 3D avatar poke / moods app. Kids are already trying to work out how they can save animations to videos. For example: http://www.youtube.com/watch?v=dkzBeern7EE

    In theory I could already directly encode uncompressed AVI or FLV files using pure actionscript code. But with a native encoder built straight in it would open adobe up to a million possible web applications based around video. Which is *huge* in this day and age. Think about flash apps that can directly generate flash videos and automatically upload them to youtube to share.

    In terms of native image support. I already do direct PNG encoding in flash. Performance isn't too bad for PNG's. But JPG + decent animated GIF encoding is much slower.

    Thanks for listening,

    Dave

    http://myspace.com/buddypoke
    http://www.orkut.com/AppInfo.aspx?appId=43931632273  

  34. # Blogger Tek

    I'm working for an online dating company, the better the quality is for a locally modified webcam snapshot or client cropped snapshot, the better the quality of the final thumbnail in the profile is. I vote to have a good JPEG and PNG (the two or nothing) native library in the player, but I also care about the weight of the two. I see that the widespread jpeg.dll is 140KB, pnglib.dll 40KB ... I don't want them in the player for such a weight.  

  35. # Anonymous Anonymous

    Not only would an encoder be cool, the ability to save it out to a file for e-mail/printing/whatever would be just as neat.

    Shishir Ghate
    Dow Jones Online Financial Solutions  

  36. # Blogger Joel

    I've been trying to build a content management system for our (massive) flow of high resolution images with AIR. Right now I am facing huge performace problems when it comes to resizing/processing the images on the client side and I am forced to push them to our server for these operations.

    It would be excellent to have the ability to process and encode large images on the client side.

    Joel Hooks
    Scientific Analysis, Inc.  

  37. # Anonymous radscientist

    Hi Ted,

    I might be a little late to the party, as I just came across this post. But I think you pretty much summed up the need by stating "As Flash Player 10 supports writing data to the local machine, Image encoding may become a bottleneck feature for many customers. As data no longer needs to traverse the network for security purposes, it makes sense to allow easy creation of native image formats in Flash Player and AIR."

    I have several current projects that focus on client-side PDF creation for prepress - so encoding those bitmaps at 300 dpi is a huge bottleneck right now.

    Along with the ability to natively encode images, Might I request some work on raising the 2880pixel cieling for bitmap data objects? Or possibly providing an abstraction api to handle larger bitmaps... Thanks for the great work!  

  38. # Anonymous Rob Cole

    YES! - I am writing an image app for AIR to prepare images for a flash-based web-app - native image encoding would be a BIG boon.

    Thanks,
    Rob Cole
    robcole.com  

  39. # Anonymous Wojciech Ptak

    This will be great feature that might really ease implementation of the features that our clients wish to have :)

    I would go for yes, give it to us :)  

  40. # Blogger Bluespark

    Hi Ted,

    This would make a big difference for processing webcam images now on Tweetr.

    But another project I want to build in AIR/Flash 10 is an image uploader (like the flickr one) but because New Zealand upload speeds are really bad it MUST compress the images. Currently for a 10 megapixel image jpegencoder is taking 30seconds and the machine is at 100% CPU which just means its not viable.

    Have asked many times for a native image encoder.
    John, www.tweet-r.com  

  41. # Blogger James Fassett

    I have worked on 3 projects generating graphical data (area-charts and bar graphs) where generating and saving pngs would be highly beneficial. I whole heartedly endorse this feature.

    James Fassett
    reggieband productions  

  42. # Anonymous Anonymous

    Ted,

    Native JPEG encoding would be a big boon for our company that is in the online photo printing business. The need to downsample large photos from today's digital cameras is very high on our priority list.

    BTW, is there a bug or feature request on bugs.adobe.com where the community can vote on? Please do let us know.

    thanks,
    Om  

  43. # Blogger Lycan

    Hi Ted,

    I just want to ask something, how will you encode the image from editing resolution to Hi Res printing image?

    I mean, I have 2 image 1 is for editing and the other one is the original for printing.

    I dont have any idea how can I encode the editing image into the original image.  

  44. # Anonymous Anonymous

    Hi Ted,

    as you say, with the addition of saving to local file, a native jpeg encoder is a must!

    We use it to scale and encode images before uploading to the server and with the mx.graphics.codecs is veeeery slow.

    Is there any Jira bug id to vote for?  

  45. # Anonymous radScientist

    Hi Ted -

    I was curious if the Alchemy project might provide the needed speed for a "native" image encoding library? Would moving the features of the AS3 corelib to C+ equivalents provide any benefit?

    Also wanted to put in a note to make sure this post doesn't die... This is an incredibly important feature for RIA's and where they are going... IMHO, it is way more important than the new "native 3d" additions to FP10.

    Skate to where the puck is! Please Don't make us wait for CS5 ...  

  46. # Anonymous Coker Isaac

    Gr8t, native image encoder will be nice but more importantly is a property or method to fetch displayObject's data. With this, libraries like AlivePDF will be able to render flash vector assets as vectors in PDF. it's a big restraint in the printing industry. Now what we do is take snapshots and encode as raster images which when enlarged, will pixellate.

    Isaac Coker  

Post a Comment



© 2008 Ted On Flash