[Image Utils Mobile] Smaller resized image is a much larger file size

[Image Utils Mobile] Smaller resized image is a much larger file size

  
Forge Component
(3)
Published on 10 Oct (6 days ago) by Harlin Setiadarma
3 votes
Published on 10 Oct (6 days ago) by Harlin Setiadarma

Dear All,


just started testing with this Image Utils Mobile PlugIn....
Strange thing (for me it is) that the resized image (Resize.MaxWidthOrHeight = Identify.width / 2) is much bigger in binary data size then the original.
Image 1: Height:600, Width 337, ByteSize = 10081
Resized Image: Height:168, Width 94, ByteSize = 38378....


Somebody??

Default resize property has sharpen factor of 0.2

Sharpening may increase binary file size (because it's more difficult to compress?).

Try sharpen 0.

(not an answer, more background)

Depending on the image format, different compression techniques are used. Images like PNG and GIF are using a horizontal compression which basically counts the number of identical color pixels. When you compress an image with lots of colors, every pixel can be different and the compression creates more overhead, increasing the file size.

Using the sharpen factor (or other kind of settings), the colors are more blended into each other, so compression can be more effective.

Create an image, square (for instance 200x200) and put a gradient from top to bottom and create a similar image with a gradient from left to right. Same amount of colors and pixels, different file size.

Images like JPG use a different kind of compression (which makes use of our difficulties to see details ;))


Humor lesson from using phone images:):):)

Never use a picture in png or gif from a modern mobile phone to create images from a screen, without decreasing the image size. The camera's are that good; Every pixel on a screen is created with colored sub pixels and stored in the image (depending on quality level).....as a result, every horizontal pixel is different.....Huge files :):):)

Been there, done that, crashed applications with it 

Patrick Baanvinger wrote:

(not an answer, more background)

Depending on the image format, different compression techniques are used. Images like PNG and GIF are using a horizontal compression which basically counts the number of identical color pixels. When you compress an image with lots of colors, every pixel can be different and the compression creates more overhead, increasing the file size.

Using the sharpen factor (or other kind of settings), the colors are more blended into each other, so compression can be more effective.

Create an image, square (for instance 200x200) and put a gradient from top to bottom and create a similar image with a gradient from left to right. Same amount of colors and pixels, different file size.

Images like JPG use a different kind of compression (which makes use of our difficulties to see details ;))


Humor lesson from using phone images:):):)

Never use a picture in png or gif from a modern mobile phone to create images from a screen, without decreasing the image size. The camera's are that good; Every pixel on a screen is created with colored sub pixels and stored in the image (depending on quality level).....as a result, every horizontal pixel is different.....Huge files :):):)

Been there, done that, crashed applications with it 

That's the reason why i asked in the first place.... Our mobile app is crashing while uploading a lot of pictures from the phone/tablet to the google drive... "Java.out-of-memory", Fatal error, Contact OutSystems Support....
So i needed a way to 'compress' the pictures, before uploading......