About the JPEG Translator
JPEG Translator for BeOS
This is an image translator that displays and saves JPEG and JFIF format file
formats. The format supports up to 24-bit depth of lossy compression. Information on first time usage can be found FAQ later in this document.
This software is based in part on the work of the Independent JPEG Group,
and I am very grateful to Thomas Lane and associates for making the JPEG
format childs play.
Understanding the Preferences
You can access the preference dialogue directly by double clicking on /boot/home/config/add-ons/Translators/JPEGTranslator or where ever you have set your translators to be
located - see the FAQ for more information.
There you can configure all the input and saving options for the JPEGTranslator. Programmers can also make this dialogue appear within their own applications, so you might often see this panel in other programs.
It is worth remembering that whenever the dialogue is closed, your settings will be automatically saved for you, and become active immediately.
Compression Quality is on a scale from 1 to 100%. At the top of the scale images receive the least level of compression, lower down the scale the most.
Input Scaling determines the output size of loaded images.
It is best to leave this setting at the default level. However, it can be
useful to have smaller, thumbnail images coming into your favourite viewing program.
Input DCT has settings which really speak for themselves. You can set which DCT
code the handler will use to decode the image; the default is slow and
accurate - crank it up if you are a speed freak!
Output Type lets you set how the image will be encoded. Progressive
encoding takes longer, but allows the image to be decoded in a progressive
manner (you can make out more of the image as the data is read - perfect
for using over a slower network). Standard image encoding is quicker but
will not allow the same effect. Its also worth noting that progressive
jpegs can often be several kilobytes smaller, but will use a LOT more
memory when they are being created.
High Quality Decode gives you the option for a slower, better looker way of displaying the image.
Programmers Information
All ioExtensions start with the code JPEG before the defined action.
They are listed below.
"JPEG/scale":int32 |
With this set, the application can
override the user preference and have the
input image scaled down by either a factor
of 2, 4 or 8. Simply set the long to the
value you require - currently 2,4 and 8 are
the only extra scaling supported, very useful
for generating thumbnail images. |
"JPEG/outgrayscale":bool |
When this is set, the output image will be
return as a B_GRAYSCALE_8_BIT, resulting in
a much quicker decode - great for previews. |
"JPEG/createprog":bool |
This is will override the user's setting of
saving images in progressive format |
Some Examples of usage
BMessage *ioMessage = new BMessage('IOMS');
// render as quarter of original size
ioMessage->AddInt32("JPEG/scale",4);
// request 8 bit data output
color_space outspace = B_COLOR_8_BIT;
ioMessage->AddData("bits/space",B_RGB_COLOR_TYPE,&outspace,sizeof(color_space));
// request non progressive save image
ioMessage->AddBool("JPEG/createprog",FALSE);
N.B. ALWAYS try and pass the JPEGTranslator 32-bit data to convert to a JPEG
if its at all possible, since when you pass the handler 8-bit data all it
is doing is expanding it to 32-bit data using the colour map. This also holds true for all other translators
unless you are given the option of sending the translator a colour map.
Program History
2.01
Fixed endian saving bug in Intel version.
2.00
Ported to Intel and the Translation Kit. Added option of high quality decoding.
Special Thanks To
Jon Watte, Jeremy Moskovish, Philippe Thomas, Olaf Seibert, Kevin Hendrickson,
Chris Herborth, Sander Stoks and Edmund Vermeulen.
License
There is no warranty with this program, and I have no liability for any consequential
damage arising from the use of or inability to use this program. In no
event shall I be liable for any damages whatsoever.
Distribution with any commerical software is strictly forbidden, either in full or demo form without a license agreement. Distribution is
also forbidden on any software collections costing over 50USD.
By reading this file and using the translator you are agreeing to the terms listed here.
Q: How do I install it?
A: You need to place it in your Translators directory. As default this is /boot/home/config/add-ons/Translators, but this may be configured differently.
Q: What is this program used for?
A: The JPEGTranslator allows programs which support datatypes to load and save JPEG
images. You can use ShowApp which is included with the BeOS to view any images in this format, but other viewers are available; one of my favourites is DTPicView by Edmund Vermeulen.
Q: Will NetPositive use the JPEGTranslator automatically?
A: No, NetPositive has its own image viewer which can display JPEG images. NetPositive does not currently support the Translation Kit.
Q: What does DCT mean?
A: DCT stands for Discrete Consine Transform. A DCT is a way of representing intensity coefficients, which is suitable
to be compressed easily due to the way the samples are concentrated into a few coefficients (did you get that?). This technique is the
cornerstone of the JPEG format as well as the MPEG video format, and is the reason for the high level of compression possible.
Contact Details
Simon Clarke (S.J.Clarke@herts.ac.uk)
If you want to distribute this translator and a user help version of this document with your application, please email me.
If there are any files which this translator does not display correctly, please let me know, and I can try and fix the
problem.