dbTalk Databases Forums  

HowTo: Preventing bitmaps in tables from looking ugly

comp.databases.paradox comp.databases.paradox


Discuss HowTo: Preventing bitmaps in tables from looking ugly in the comp.databases.paradox forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Sundial Services
 
Posts: n/a

Default HowTo: Preventing bitmaps in tables from looking ugly - 02-17-2006 , 02:13 PM






So... you put a graphic from a file into a Paradox "graphic" field and ...

.... what the ^@$@%#%?! ... it looks like an Impressionist painting ... by a
madman!

What happened, and what do you do about it?

EXPLANATION OF THE PROBLEM:
The root cause of this problem is that Paradox provides only 256 colors in
its "palettes." Palettes are a table of colors, indexed by number, which
identify all of the colors used on an image. Typical bitmaps and JPEGs
contain palettes with thousands or even tens of thousands of entries.
These must be squeezed down to 256... and if several bitmaps are on the
screen at the same time, all of them TOGETHER must be squeezed into this
color-space. (The process is called "quantizing.") Paradox is perfectly
awful at doing this.

WHAT DO YOU DO?
The solution is to pre-process images, using external tools, before you
import them into Paradox. You should convert them into Windows Bitmap
format and you should reduce the color-palette to less-than 256 colors.
Then import that image. Paradox won't have to do anything more to it,
which also avoids nasty problems in Paradox 8-10 that manifest when you try
to LoadFromFile() a bunch of JPG images in a row.

HOW CAN YOU DO IT?
I used the tool ImageMagick (http://www.imagemagick.org) which is a very
powerful, open-source graphic manipulation suite. It's free. I used the
"Convert" command-line program.

In ObjectPAL, the "Convert" program is run programmtically with a
command-line like this:
CONVERT -colors 128 -colorspace RGB foo.jpg BMP3:bar.bmp
... then loadFromFile("bar.bmp") and delete this temporary file.
("convert" is an ImageMagick program.)

WHY 128 COLORS?
The above example has boiled the color-palette on the image all the way down
to only 128 colors. That isn't a "magic" number, only a number that is
"quite a bit" less than 256. What I'm trying to do is to increase the
chances that Paradox will be able to display my image, and maybe several
images at a time, without having to /further/ re-map the colors that I'm
providing. I'm trying to improve the odds that it will have enough space
in its limited palette to fit all of my colors without having to quantize
any of them still further.

----
ChimneySweep(R): F-A-A-ST table repair at a click of the mouse!
http://www.sundialservices.com/products/chimneysweep

Reply With Quote
  #2  
Old   
Jostein Bakke
 
Posts: n/a

Default Re: HowTo: Preventing bitmaps in tables from looking ugly - 02-19-2006 , 01:10 PM






Thanks, this was interesting info. I'll try this out.

Bitmap seems to look OK if they're in 100% size, but if you reduce the size
they look bad - on screen. On paper, however, Paradox seems to be able to
make them look good always.

Jostein Bakke



Reply With Quote
  #3  
Old   
Sundial Services
 
Posts: n/a

Default Re: HowTo: Preventing bitmaps in tables from looking ugly - 02-19-2006 , 05:05 PM



Jostein Bakke wrote:
Quote:
Thanks, this was interesting info. I'll try this out.
Bitmap seems to look OK if they're in 100% size, but if you reduce the
size they look bad - on screen. On paper, however, Paradox seems to be
able to make them look good always.
Resizing, as I have seen it, does not seem to be a huge problem. But huge
palettes (a digital camera might generate an image with 64,000 entries) are
definitely a problem for Paradox (and Access, for that matter).

ImageMagick does a very good job of reducing the color-space, even such a
large jump as squeezing 64,000 colors down to 120. And once the colors
have been made "manageable," Paradox is fine with them. So it goes.

The goofy thing .. what had me puzzled for so long .. is that an /excess/ of
color information produces an output with /few/ useful colors.

----
ChimneySweep(R): F-A-A-ST table repair at a click of the mouse!
http://www.sundialservices.com/products/chimneysweep


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.