17 Replies Latest reply on May 24, 2006 11:58 AM by Ned_Wright

    JPEG Vs PNG

    nardove
      hi there, here is a question i have but first i want to apologise for my writting im still learning english

      ok here it is, hoping that some one who can backup his/her answer read this

      if every time i use png results in small file size WHY do i want to use jpeg instead?

      im using flash mx 2004

      thanks you very much
        • 1. Re: JPEG Vs PNG
          Level 7
          nardove,

          > if every time i use png results in small file size WHY do i want
          > to use jpeg instead?

          Personally, I try to keep my imported images lossless. I tend to use
          BMP unless I need transparency, in which case I used PNG. This allows me to
          adjust my publish settings in Flash to decide how "heavy" to make my SWF
          file.

          If you use a highly compressed JPG in your FLA file, you must re-create
          the JPG if you decide the image is too compressed. If you use a BMP or PNG,
          you can leave such images as-is.


          David
          stiller (at) quip (dot) net
          Dev essays: http://www.quip.net/blog/
          "Luck is the residue of good design."


          • 2. Re: JPEG Vs PNG
            nardove Level 1
            that is another reason to why to boder using jpegs

            thanks david
            • 3. Re: JPEG Vs PNG
              2m Level 2
              As usual I only add to a thread that David has taken part in to contadict him.

              (I only do this because normaly his answers are so good I just sit there, adore him, and keep my mouth shut. But on very rare occasions I have to add something. ;-) )

              I almost always use jpegs for photographic images, and wont flash have them recompress. For other (drawing) images, i use png and lossless compression mostly.

              The reason is, that I do photos in Photoshop (now that Macromedia is part of adobe I can be open about that ;-) ) and Photoshop generates (sometimes much) better quality results in jpegs at the same size (or smaler size at same quality) than any other application i tested (I tested a lot of them) including Flash.

              It is true that I have to update the jpeg, if I need to recompress a photo, but usually I won't have to, as I co for the lowest acceptable quality in the first place (I don't accept very low quality though).

              If you want to squezze out the last bit of quality at minimal filesize, use jpegs made in Photoshop, if you often reconsider compression decissions go for david's way which is more work efficent.
              • 4. Re: JPEG Vs PNG
                nardove Level 1
                yes but still not convinced

                lets see what other people have to say

                thanks 2m
                • 5. Re: JPEG Vs PNG
                  2m Level 2
                  Hey I didn't event try to convince you!

                  ;-)
                  • 6. Re: JPEG Vs PNG
                    Level 7
                    2m,

                    >> The reason is, that I do photos in Photoshop [... which] generates
                    >> (sometimes much) better quality results in jpegs at the same size
                    >> (or smaler size at same quality) than any other application i tested

                    Fair enough.

                    > If you want to squezze out the last bit of quality at minimal filesize,
                    > use jpegs made in Photoshop, if you often reconsider compression
                    > decissions go for david's way which is more work efficent.

                    Your point really is a good one, 2m. It goes to show how flexible Flash
                    is -- how many different ways people use the application. Often, I'm
                    required to export a low-bandwidth and high-bandwidth version (and sometimes
                    even video output), so it helps to perform quick Publish Settings
                    adjustments.

                    But there's certainly something to be said for your Photoshop approach.
                    And in fact, there are reasons to import other file formats as well, such as
                    GIF. GIF supports animation, for example, and its indexed palette can
                    sometimes save even more bandwidth than a comparably compresssed JPG.


                    David
                    stiller (at) quip (dot) net
                    Dev essays: http://www.quip.net/blog/
                    "Luck is the residue of good design."


                    • 7. Re: JPEG Vs PNG
                      Level 7
                      > if every time i use png results in small file size WHY do i want to use
                      > jpeg
                      > instead?

                      You don't ... there is no advantage as long as you are happy with the
                      results (some people experience colour problems with PNG depending on how
                      the PNG was created). If PNG gives the best file size for the SWF at the
                      quality you want, then use it. By the time it gets into the SWf file, the
                      format makes no difference at all.
                      --
                      Jeckyl


                      • 8. Re: JPEG Vs PNG
                        Level 7
                        General strategy is:

                        If you have special software that produces more highly compressed JPEG files
                        (eg there are some where you can adjust the quality in different parts of
                        the image to get smaller files) .. then import the JPEG directly. That does
                        mean you should then make any changes in the original image and recreate the
                        Jpg and reimport it if you need to change it.

                        If not, get an original lossless image (like BMP or PNG) and import that
                        into Flash and do the compression there (choosing either lossless or lossy
                        compressions as appropriate).

                        What counts in the end is only the resultant image quality and file size for
                        the SWF.
                        --
                        Jeckyl


                        • 9. Re: JPEG Vs PNG
                          nardove Level 1
                          i thinks that too, at the end doesnt matter then what is important is the final swf

                          ill keep using my png is just that there must be something probably using png is not a good practice in some cases but how can you know that

                          thanks
                          • 10. Re: JPEG Vs PNG
                            2m Level 2
                            If your interessted in the details, you should try to find more general information on image formats and compression.

                            The topic is not limeted to the use of images in Flash, but is a common issue when using images for the web or for digital publishing in general.

                            I'm sorry that I can't provide you with a good link or reading top right now, but it shouldn't be to hard to find.
                            • 11. Re: JPEG Vs PNG
                              Level 7
                              > The topic is not limeted to the use of images in Flash, but is a common
                              > issue
                              > when using images for the web or for digital publishing in general.

                              Info on images for the web or digital publishing will not be of much use as
                              it is pretty much irrelevant once the image is in a SWF file. There may be
                              some very general information about the supported import formats for Flash
                              .. but all you really need to know is whether they are lossy or lossless,
                              and that JPEG files are special because they can be used as-is in the SWF
                              file (so you can (for JPEG files only) do some special processing to
                              optimise them better). Other formats all get converted to either JPEG or
                              zipped bitmap images in the SWF file. There are no PNG or GIF or BMP format
                              data in the SWF .. and even if there were, the player renders everything the
                              same.

                              NOTE: You can, with Flash player 8 and SWf8 published files, load in PNG
                              files now (and I think some other formats), as well as JPEG at runtime. In
                              this case the actual file size of the image is important re:bandwidth, but
                              other features of the formats are not really all that important (as long as
                              the image looks how you want in that format).
                              --
                              Jeckyl


                              • 12. Re: JPEG Vs PNG
                                2m Level 2
                                I certain cases Jeckyl is right, the format of the image that you have imported into flash can be irrelevant, as your flash settings might uncompress and recompress the images.

                                On the other hand to decide which form of compression (eg. jpeg or png/gif) to use on a bitmap inside flash follows similar rules as the decission for general (web-)use.

                                [Like using gifs for smaler files, jpegs (due to headersize) only for larger ones, gif for graphics with mostly text and lines...]

                                Ther are some specialties to flash, but to understand what you are diong in flash when choosing one or the other compression I find a general understanding of image formats etc. very helpful.




                                • 13. Re: JPEG Vs PNG
                                  nardove Level 1
                                  thanks again everybody
                                  • 14. Re: JPEG Vs PNG
                                    Level 7
                                    > On the other hand to decide which form of compression (eg. jpeg or
                                    > png/gif) to
                                    > use on a bitmap inside flash follows similar rules as the decission for
                                    > general
                                    > (web-)use.

                                    The rule is simple .. try lossless formats and lossy to see which once gives
                                    you the smallest size at acceptable quality. Then pick that one.

                                    This is not quite the same as for web, as the images in a SWF are not GIF
                                    nor PNG not BMP .. so the usual 'rules' don't exactly apply.

                                    One will often (but not always) find that cartoon-ish and simple screen
                                    captured images are best with 8bpp lossless compression .. photo images are
                                    often best with JPEG compression .. but the other lossless formats may give
                                    better results in some cases. There's no real 'rule' you can apply .. you
                                    really do need to experiemtn to work out the best.

                                    > I find a general understanding of image formats etc. very helpful.

                                    Yes . but just remember that much of it doesn't apply to Flash.
                                    --
                                    Jeckyl


                                    • 15. Re: JPEG Vs PNG
                                      Ned_Wright
                                      Is there any advantage to using one file type over another on a slower computer, for performance gains? I'm running on a last gen 12" powerbook, and sometimes flash just crawls.

                                      Thanks,
                                      Ned
                                      • 16. Re: JPEG Vs PNG
                                        Level 7
                                        > Is there any advantage to using one file type over another on a slower
                                        > computer, for performance gains? I'm running on a last gen 12" powerbook,
                                        > and sometimes flash just crawls.

                                        Already compressed JPEG would be fastest as Flash doesn't need to recompress
                                        it.

                                        Otherwise its probably swings and roundabouts .. uncompressed images don't
                                        need decompressing, but they are larger files.

                                        What may be better is reducing the size of your image in a image editor and
                                        scale them to the size you want .. that will reduce file size and reduce the
                                        image processing load (if that is what is slowing things down).
                                        --
                                        Jeckyl


                                        • 17. Re: JPEG Vs PNG
                                          Ned_Wright Level 1
                                          thanks for the help...

                                          Ned