Why PNG compression is that much slower than JPEG on Android?

I’ve been toying with Android Bitmaps a bit and found out, that PNG compression takes much more time than even highest quality JPEG one. Much much more. On my device it can be roughly up to 10 seconds against 1.

AFAIK, PNG is basically filtered strings of pixels compressed with deflate. Well, finding the best filter for each string might be time consuming task, but there can be compromise established between speed and compression effectiveness. It shouldn’t be that slower than JPEG. How come it is?

  • Error on some devices - couldn't find class 'com.google.android.gms.measurement.internal.zzz'
  • How to send and receive broadcast message
  • Android: Drag and Drop issue
  • android hourglass
  • open failed: EBUSY (Device or resource busy)
  • How to close navigation drawer when an item is pressed from it?
  • Maybe it’s the other way around. Is there some ultra-fast JPEG implementation on Android?

    UPDATE: I realy just do things like

    mBitmap.compress(CompressFormat.JPEG, 100, stream);
    

    and

    mBitmap.compress(CompressFormat.PNG, 100, stream);
    

    Related posts:

    Inserting the current year into a TextView
    Animated splash screen with Phonegap
    Facebook URL Scheme does not work fb://publish
    Inter-device communication via Bluetooth using Phonegap on Android?
    Is String a primitive or an Object in Android or Java?
    Android logcat logging only info level on real device. Cannot get debug messages, not even unhandled...
  • TimePickerDialog and AM or PM
  • What does an EditText.getText() in android return if it is empty?
  • Video clarity with my code is bit low as compared to recording with Android camera
  • Android Studio Best way import module from other repository
  • AlertDialog with checkbox In android
  • How to redirect user to a particular app in Market?
  • One Solution collect form web for “Why PNG compression is that much slower than JPEG on Android?”

    I’ve tested my project on emulator with much bigger pictures and though PNG compression was little slower, there was no drastic difference in performance. Therefore it should be due to the hardware acceleration, as told by BitBank in the comment.

    Android Babe is a Google Android Fan, All about Android Phones, Android Wear, Android Dev and Android Games Apps and so on.