PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Friday, May 6, 2022

[FIXED] Why aren't grey images (1 channel) 1/3 smaller than colored images (3 channels)?

 May 06, 2022     image, image-processing, opencv     No comments   

Issue

I already know that in memory a single channel image is way smaller than a colored one, something around 1/3 the original size (just guessing). But why after we create a file with that image doesn't the size reduction persist? I did some tests and a colored image with 127 KB after greyscale have 118 KB. Why does this difference happen? And why it is so small?


Solution

If someone ever struggle with this question this is the answer thanks to Mark Setchell and beaker comments.

The problem is that I was trying to map the "in memory" concept of the image, with three channels and so on, with the compression format, but every compression format have his own witchcraft techniques to best represent a image. The JPEG format (the one that I was using) don't is so affected by the colored / gray images difference. But with PNG the difference was around 2.5 times.



Answered By - Will Glück
Answer Checked By - Katrina (PHPFixing Volunteer)
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing