Robby
2010-04-16 14:58:01 UTC
Hello,
I am creating my own icons/ pictures for an embedded system. Basically, I am
storing these images (pictures and icons) into an external flash. I then
fecth this information and have a grapics library (EasyGUI) display it onto
an LCD screen.
Having unique designs for icons and pictures I do have the choice of
displaying them on three different LCD sizes... 1.5", 2.0" and 2.8". So if I
fecth an icon for the 1.5" LCD screen, I display it as it as stored which
fits exactly in this screen size. But if I then use a 2.0" screen with a
wider pixel resolution, my same icon or pictures will display too small. The
obvious solution would be to store every icon and picture three times each
one corresponding to a screen size. But that's no good, I would be wasting a
lot of memory.
So I thought of storing the smallest icon or picture size in flash and
depending on the LCD screen size being used, I would load the icon or pic and
enlarge the image accordingly. But this brings up the following problem.
For example if I have an icon with 5 pixels wide by 1 pixel high with the
following colors:
[red] [orange] [blue] [grey] [green]
and lets suppose this icon fits perfectly for the 1.5" LCD. But if I need to
display it for the 2.0" LCD, I can double the colors and display it like this:
[red] [red] [orange] [orange] [blue] [blue] [grey] [grey] [green] [green]
In terms of pixles lets bare in mind that the 1.5" LCD is 176 pixels wide
and that the 2.0" LCD is 220 pixles wide. So in proportion we see that a 2.0"
LCD is not double the pixel density size of the 1.5" LCD. Geting back to the
5 pixels wide icon (the original one) I would have to increase its width by
approximately 1.25 times to proportionally display it on the 2.0" LCD which
is about 7 pixels wide instead of 5.
So the question is which pixels would I double in order to still maintain
the same icon image. Okay, okay... in this case we might all agree to just
double up any two pixels ... fro example the red and the blue. So I put it to
the test. I opened a graphics editor and drew the simple 5 x 1 pixel icon and
streched it one pixel to the right and this is what I got:
[red] [orange] [blue] [grey] [green] [green]
and then streched it one more pixle to the right, and to my surpise, this is
what I got:
[red] [orange] [orange] [blue] [grey][grey] [green]
Now, why did the editor decide to remove a green, and add a grey and orange???
The reason I am asking this is, if I will store every icon and picture once
in external flash, I need to know what pixles I need to double so that my
icon or pics get enlarged but don't lose their graphical integrity or
appearence. I might want to display these icons/pics in many different sizes,
my question to you guy's, is their a certain algorithm or rule of thumb used
when elarging or reducing graphics?
All feedback appreciated.
Rob
I am creating my own icons/ pictures for an embedded system. Basically, I am
storing these images (pictures and icons) into an external flash. I then
fecth this information and have a grapics library (EasyGUI) display it onto
an LCD screen.
Having unique designs for icons and pictures I do have the choice of
displaying them on three different LCD sizes... 1.5", 2.0" and 2.8". So if I
fecth an icon for the 1.5" LCD screen, I display it as it as stored which
fits exactly in this screen size. But if I then use a 2.0" screen with a
wider pixel resolution, my same icon or pictures will display too small. The
obvious solution would be to store every icon and picture three times each
one corresponding to a screen size. But that's no good, I would be wasting a
lot of memory.
So I thought of storing the smallest icon or picture size in flash and
depending on the LCD screen size being used, I would load the icon or pic and
enlarge the image accordingly. But this brings up the following problem.
For example if I have an icon with 5 pixels wide by 1 pixel high with the
following colors:
[red] [orange] [blue] [grey] [green]
and lets suppose this icon fits perfectly for the 1.5" LCD. But if I need to
display it for the 2.0" LCD, I can double the colors and display it like this:
[red] [red] [orange] [orange] [blue] [blue] [grey] [grey] [green] [green]
In terms of pixles lets bare in mind that the 1.5" LCD is 176 pixels wide
and that the 2.0" LCD is 220 pixles wide. So in proportion we see that a 2.0"
LCD is not double the pixel density size of the 1.5" LCD. Geting back to the
5 pixels wide icon (the original one) I would have to increase its width by
approximately 1.25 times to proportionally display it on the 2.0" LCD which
is about 7 pixels wide instead of 5.
So the question is which pixels would I double in order to still maintain
the same icon image. Okay, okay... in this case we might all agree to just
double up any two pixels ... fro example the red and the blue. So I put it to
the test. I opened a graphics editor and drew the simple 5 x 1 pixel icon and
streched it one pixel to the right and this is what I got:
[red] [orange] [blue] [grey] [green] [green]
and then streched it one more pixle to the right, and to my surpise, this is
what I got:
[red] [orange] [orange] [blue] [grey][grey] [green]
Now, why did the editor decide to remove a green, and add a grey and orange???
The reason I am asking this is, if I will store every icon and picture once
in external flash, I need to know what pixles I need to double so that my
icon or pics get enlarged but don't lose their graphical integrity or
appearence. I might want to display these icons/pics in many different sizes,
my question to you guy's, is their a certain algorithm or rule of thumb used
when elarging or reducing graphics?
All feedback appreciated.
Rob