Different colors combinations effect on image size

By: Prof. Dr. Fazal Rehman | Last updated: March 3, 2022

Different colors combinations effect on image size

Author: Fazal Rehman (Shamil)

CEO T4Tutorials.com

Abstract

To increase the image optimization rate is a big problem especially for web-based application and big data. There are many guidelines and techniques to optimize the image. But still, there is a need to increase the image optimization rate. Among image optimization techniques most common is image cropping, optimization of image dimensions, deletion of irrelevant image layers and headers and save the image as “save for web”. Save the image for the web is mostly used by web designers. Among these techniques, we have proposed the image optimization technique by selecting the appropriate optimized colors. We use the Microsoft windows paint and compare the different images with different colors. We conclude that color is a prominent factor that affects the image size. Some colors are found to have very much size as compared to other colors. We also find that some colors having a difference of 24%. Most of the colors have 3% to 8% difference with each other. This appropriate color selection boosts the image optimization rate of an image.

INTRODUCTION

Now in the era of big data and web, it is a problem to optimize the images with extreme limit without reducing the quality of the image. When images are not optimized they create the problem to store, upload, download and to share the images.

There are different image optimization techniques to reduce the image size. Some of these techniques optimize the image and also reduce the quality of images. However, some techniques optimize the images without losing the quality of the image. It is always an interest of the web designers to decrease the size of an image more and more. The optimized image has many advantages over the non-optimized image [6]. Some of the advantages are;

  • Fast uploading
  • Fast downloading
  • Fast response
  • Efficient SEO
  • Less bandwidth usage etc.

Image optimization techniques work better and our proposed guidelines support to decrease the size of an image before optimizing an image.

We proposed guidelines to select colors according to their size. We have introduced in our research that colors effects on image size. If someone chose the color according to our guidelines, then optimized images are produced. We use the Microsoft windows paint and select colors one by one and save the images. After the image creation, we evaluate the images size. During experiments, we have found a different hidden pattern in colors.  During the experiments with PNG images, all colors are observed to have different size. The red color is observed to have more size as compared to Green and Green observed to have more size as compared to Blue. Red with Green occupies more space as compared to Red with Blue. Green with Red occupies more space as compared to Green with Blue.

Blue with Red occupied more space as compared to Blue with Green.

METHODOLOGY:

During the experiments, we open the Microsoft windows paint and set the dimensions of an image. The dimension of the image is taken by both keeping the aspect ratio and without keeping the aspect ratio. We start with X and Y axis as 1 and then we increase the axis by 2*2 and then 500*500, 1000 *1000 and 500 * 1000. We create the different images by selecting the different hue, saturation, and luminance of the color. After that, we save the image and evaluate the size of the image with other images having different colors.DATA SET AND EXPERIMENTS

There are thousands of color combinations used as data as discussed below [16-18];

Single color:

Red – Total 256 colors

Green – Total 256 colors

Blue – Total  256 colors

Two colors:

Red + Green –  Total 196608 colors

Red + Blu – Total  196608 colors

Blue + Green – Total 196608 colors

Three colors:

Red + Green + Blue – Total 589824 colors

It is very difficult to manage such a large number of colors and images. So we adopt the simple boundary value testing technique to evaluate the colors [20]. We test the colors on their boundaries. Selected boundaries are as following;

Min is the minimum value of color.

Min+ is the one value above the minimum value of color. Nominal is the middle value of color. Max- is the one value below the maximum value of color. Max is the maximum value of color.

  R
1Min0
2Min+1
3Nominal127
4Max-254
5Max255

Table 1:  Boundary values for Red color (Single color)

  G
1Min0
2Min+1
3Nominal127
4Max-254
5Max255

Table 2:  Boundary values for Green color (Single color)

  B
1Min0
2Min+1
3Nominal127
4Max-254
5Max255

 Table 3: Boundary values for Blue color (Single color)

colors effect on image size

Figure 1: Illustration of research methodology

red green blue RGB color values affect the image size

 Size 
 ColourMixtureDimension

1*1

Dimension

2*2

Dimension

500*500

Dimension

1000*1000

Dimension

500*1000

IDRGB      
1000No Colour1191183402132166675
2100R1191234806165719477
312700R1191234806165719477
425400R1191234806165719477
525500R1191234806165719477
6010G1191224168150768199
701270G1191224168150768199
802540G1191224168150768199
902550G1191224168150768199
10001B1191224167150748197
1100127B1191224167150748197
1200254B1191224167150748197
1300255B1191224167150748197
141271270R+G1191234806165729478
1612710R+G1191234806165729478
171272540R+G1191234806165729478
181272550R+G1191234806165729478
2011270R+G1191234806165729478
212541270R+G1191234806165729478
222551270R+G1191234806165729478
2412701R+B1191234419156408700
251270127R+B1191234419156408700
261270254R+B1191234419156408700
271270255R+B1191234419156408700
2910127R+B1191234419156408700
302540127R+B1191234419156408700
312550
127R+B1191234419156408700
3301271G+B1191224169150778200
340127127G+B1191224169150778200
350127254G+B1191224169150778200
360127255G+B1191224169150778200
3801127G+B1191224169150778200
390254127G+B1191224169150778200
400255127G+B1191224169150778200
421271271R+G+B1191234419156408701
43127127127R+G+B1191234419156408701
44127127254R+G+B1191234419156408701
45127127255R+G+B1191234419156408701
471127127R+G+B1191234419156408701
48254127127R+G+B1191234419156408701
49255127127R+G+B1191234419156408701
511271127R+G+B1191234419156408701
52127254127R+G+B1191234419156408701
53127255127R+G+B1191234419156408701

Table 8: Illustration of images size (Type: PNG) with different dimension

 Size 
 ColourMixtureDimension

1*1

Dimension

2*2

Dimension

500*500

Dimension

1000*1000

Dimension

500*1000

IDRGB      
1100R6316314723165038691
212700R6346344726165068694
325400R6356354727165078695
425500R6356354727165078695
5010G6316314723165038691
601270G6346344726165068694
702540G6356354727165078695
80255
0G6356354727165078695
9001B6316314723165038691
100127B6346344726165068694
1100254B6356354727165078695
1200255B6356354727165078695
131271270R+G6356354727165078695
1412710R+G6346344726165068695
151272540R+G6346344727165068695
161272550R+G6356354727165078695
2711270R+G6346344726165068695
182541270R+G6356354727165078695
192551270R+G6356354727165078695
2012701R+B6346344726165068694
211270127R+B6356354727165078694
221270254R+B6356354727165078694
231270255R+B6356354727165078694
2410127R+B6346344726165068694
252540127R+B6346344727165068694
262550127R+B6346344727165068694
2701271G+B6346344726165068694
280127127G+B6346344726165068694
290127254G+B6356354727165078694
300127255G+B6356354726165078694
3101127G+B6346344726165068694
320254127G+B6346344726165068694
330255127G+B6346344727165068694
341271271R+G+B6336334725165058694
35127127127R+G+B6306304722165028694
36127127254R+G+B6336334725165058694
37127127255R+G+B6336334725165058694
381127127R+G+B6346344725165068694
39254127127R+G+B6346344722165068694
40255127127R+G+B6346344725165068694
411271127R+G+B6356354726165078694
42127254127R+G+B6356354725165078694
43127255127R+G+B6356354722165078694

Table 9:  Illustration of images size (type: JPG) with different dimension

color size hierarchy, color pixels affect the image size

Figure 2: Level 1 represents an image with large size, size decreases when we move to the bottom.

image size and color pixels RGB Values

0 to 255 RGB values and image size

red green blue occupies less high image size space

one two and three colors and image size

 

one color occupies less space than two colors

RESULTS

During the experiments with single colored (0-255) PNG images, we get the following results as illustrated in Figure 2-7 and in Table 10, 11;

Red color (0-255) occupies more space as compared to Green (0-255). Red color with dimension 500 * 100 occupies 13.48528 % extra space, with dimension 1000 * 1000 occupies 9.02179% extra space, with dimaension500 * 500 occupies 13.27507% extra space, with dimension 2 *2 occupies 0.813008% extra space and same size on dimension 1 * 1.

Red color (0-255) occupies more space as compared to blue (0-255). Red color with dimension 500 * 1000 occupies 13.50638% extra space, with dimension 1000 * 1000 occupies 9.03385% extra space, with dimension 500 * 500 occupies 13.29588% extra space, with dimension 2 * 2 occupies 0.813008% extra space and same size on dimension 1 * 1.

Green color (0-255) occupies more space as compared to blue (0-255). Green color with dimension 500 * 1000 occupies 0.0243932% extra space, with dimension 1000 * 1000 occupies 0.01326612% extra space, with dimension 500 * 500 occupies 0.0239923% extra space and same size on dimension 2 * 2 and 1 * 1.

Red color (0-255) occupies more space as compared to black (0-0-0).  Red color with dimension 500 * 1000 occupies 29.5663% extra space, with dimension 1000 * 1000 occupies 20.2462 extra space, with dimension 500 * 500 occupies 8.40616% extra space, with dimension 2 * 2 occupies 4.06504% more extra space and same size on dimension 1 * 1.

Green color (0-255) occupies more space as compared to black (0-0-0).  Green color with dimension 500 * 1000 occupies 24.68594% extra space, with dimension 1000 * 1000 occupies 12.3375% extra space, with dimension 500 * 500 occupies 18.37812% extra space, with dimension 2 * 2 occupies 3.27869% more extra space and same size on dimension 1 * 1.

Blue color (0-255) occupies more space as compared to black (0-0-0). Blue color with dimension 500 * 1000 occupies 18.56777% extra space, with dimension 1000 * 1000 occupies 12.3375% extra space, with dimension 500 * 500 occupies 18.35853% extra space, with dimension 2 * 2 occupies 3.27869% more extra space and same size on dimension 1 * 1.

IDDifference BetweenDifference Of Size in %Less PreferredMore preferredDimension
1Red,  Green13.48528RedGreen500*1000
2Red,  Green9.02179RedGreen10000*1000
3Red,  Green13.27507RedGreen500*500
4Red,  Green0.813008RedGreen2*2
5Red,  Green0.00NullNull1*1
6Red,  Blue13.50638RedBlue500*1000
7Red,  Blue9.03385RedBlue1000*1000
8Red,  Blue13.29588GreenBlue500*500
9Red,  Blue0.813008GreenBlue2*2
10Red,  Blue0.00NullNull1*1
11Green,  Blue0.0243932GreenBlue500*1000
12Green,  Blue0.01326612GreenBlue1000*1000
13Green,  Blue0.0239923GreenBlue500*500
14Green,  Blue0.00NullNull2*2
15Green,  Blue0.00NullNull1*1
16Black,  Blue18.56777BlueBlack500 * 1000
17Black,  Blue12.3375BlueBlack1000 * 1000
18Black,  Blue18.35853BlueBlack500 * 500
19Black,  Blue3.27869BlueBlack2 * 2
20Black,  Blue0.00NullNull1*1
21Black, Green24.68594GreenBlack500 * 1000
22Black, Green12.3375GreenBlack1000 * 1000
23Black, Green18.37812GreenBlack500 * 500
24Black, Green3.27869GreenBlack2 * 2
25Black, Green0.00NullNull1*1
26Black, Red29.5663RedBlack500 * 1000
27Black, Red20.2462RedBlack1000 * 1000
28Black, Red8.40616RedBlack5000 * 500
29Black, Red4.06504RedBlack2 * 2
30Black, Red0.00NullNull1 * 1

Table 10: Illustration of difference between single color with single colo

During the experiments with two colored (0-255, 0-255) PNG images, we get the following results as illustrated in Figure 2-7 and in Table 10,11;

Red with Green color (1-255, 1-255) occupies more space as compared to Red with Blue (1-255, 1-255). Red with Green color with dimension 500 * 100 occupies 8.20848 % extra space, with dimension 1000 * 1000 occupies 5.62394% extra space, with dimension 500 * 500 occupies 8.05243% extra space, with dimension 2 *2 and 1 * 1 occupies same space.

Green with Red color (1-255, 1-255) occupies more space as compared to Green with Blue color (1-255, 1-255). Green with Red color with dimension 500 * 100 occupies 13.48386% extra space, with dimension 1000 * 1000 occupies 9.02124% extra space, with dimension 500 * 500 occupies 13.25427% extra space, with dimension 2 *2 occupies 0.813008% extra space and occupies same space on dimension 1 * 1.

Blue with Red color (1-255, 1-255) occupies more space as compared to Blue with Green color (1-255, 1-255). Blue with Red color with dimension 500 * 100 occupies 5.74713% extra space, with dimension 1000 * 1000 occupies 3.599744% extra space, with dimension 500 * 500 occupies 5.65739%extra space, with dimension 2 *2 occupies 0.813008% extra space and occupies same space on dimension 1 * 1.

IDDifference BetweenDifference Of Size in %Less PreferredMore preferred Dimension
1Red + Green,  Red + Blue8.20848Red +GreenRed + Blue500*1000
2Red + Green,  Red + Blue5.62394Red +GreenRed + Blue10000*1000
3Red + Green,  Red + Blue8.05243Red +GreenRed + Blue500*500
4Red + Green,  Red + Blue0.00NullNull2*2
5Red + Green,  Red + Blue0.00NullNull1*1
6Green + Blue ,  Green + Red13.48386Green + RedGreen + Blue500*1000
7Green + Blue ,  Green + Red9.02124Green + RedGreen + Blue1000*1000
8Green + Blue ,  Green + Red13.25427Green + RedGreen + Blue500*500
9Green + Blue ,  Green + Red0.813008Green + RedGreen + Blue2*2
10Green + Blue ,  Green + Red0.00NullNull1*1
11Blue + Green ,  Blue + Red5.74713Blue + RedBlue + Green500*1000
12Blue + Green ,  Blue + Red3.599744Blue + RedBlue + Green1000*1000
13Blue + Green ,  Blue + Red5.65739Blue + RedBlue + Green500*500
14Blue + Green ,  Blue + Red0.813008Blue + RedBlue + Green2*2
15Blue + Green ,  Blue + Red0.00NullNull1*1

Table 11: Illustration of difference between two colors ( 1-255, 1-255) with two color.

During the experiments with single color (0-255) JPG images, we get the following results as illustrated in Figure 8-12;

Red color with value 1-255 have different size

Green color with value 1-255 have different size

Blue color with value 1-255 have different size

Red, Green and Blue color have the same size.

CONCLUSIONS

Image size is a challenging problem especially for web and when we want to have big data. Different techniques are available to optimize the image. Our proposed research shows different behavior of different colors. We conclude that most colors have different size. Color is a factor that can affect the image size. In PNG images Blue have less size as compared to Green. Green has less size as compared to Red. Similarly Red with Blue has less size as compared to Red with Green. Green with Blue has less size as compared to Green with Red. Blue with Green has less size as compared to Blue with Red.

In PNG images, different colors have the same size.eg; Red, Green, and Blue have the same size but one color with values 1-255 have different size. e.g.; Red color with values 1-255 has different size against each value.

AUTHOR

Fazal Rehman (Shamil) is working as a professor in University Of Shamil, Pakistan. My research is focused on web engineering, E-commerce and software modeling.

Leave a Reply