Create 12bit JPEG files

IRIX and IRIX software discussion including open source and commerical offerings.
Forum rules
Any posts concerning pirated software or offering to buy/sell/trade commercial software are subject to removal.
User avatar
mila
Posts: 296
Joined: Thu Dec 31, 2009 4:20 am
Location: Bålsta, Sweden

Create 12bit JPEG files

Unread postby mila » Wed Jan 19, 2011 7:30 am

Hi,

I need to test some hardware that I am designing and need a tools that can create 12bit JPEG files, b/w or colour?

/michael
--
No Microsoft product was used in any way to write or send this text.
If you use a Microsoft product to read it, you're doing so at your own
risk.

fieldframe
Posts: 136
Joined: Tue Aug 01, 2006 7:40 am
Location: London

Re: Create 12bit JPEG files

Unread postby fieldframe » Fri Jan 21, 2011 1:55 pm

libjpeg can be compiled for 12 bit/channel support (though you lose 8 bit/channel support in the process). You will need to write something to load or generate your image before using libjpeg to write the jpeg codestreams. Not sure anything commercially makes 12 bit jpegs. I use libjpeg in my code but there's been just no call for 12 bit files.

User avatar
mila
Posts: 296
Joined: Thu Dec 31, 2009 4:20 am
Location: Bålsta, Sweden

Re: Create 12bit JPEG files

Unread postby mila » Fri Jan 21, 2011 3:33 pm

Being a HW guy thats is to much for me to do. We do have some apps that does that but I wanted a simplier tool to make the files.

The HW I am doing does 12 but JPEG but since I have some problems and the SW side have issues to read my data I was looking for something to test on to make sure if SW or me was to blame.
I am surprised that imagej cant write nor read 12 but JPEG, otherwise a great java code!
--
No Microsoft product was used in any way to write or send this text.
If you use a Microsoft product to read it, you're doing so at your own
risk.

User avatar
vishnu
Posts: 2256
Joined: Sun Mar 18, 2007 3:25 pm
Location: Minneapolis, Minnesota USA

Re: Create 12bit JPEG files

Unread postby vishnu » Sat Jan 22, 2011 8:46 pm

gdal claims to be able to do it: http://www.gdal.org/frmt_jpeg.html

A wiki page: http://trac.osgeo.org/gdal/wiki/TIFF12BitJPEG

from the install.txt file in the current version of libjpeg:

Code: Select all

Support for 12-bit-deep pixel data:

The JPEG standard allows either 8-bit or 12-bit data precision.  (For color,
this means 8 or 12 bits per channel, of course.)  If you need to work with
deeper than 8-bit data, you can compile the IJG code for 12-bit operation.
To do so:
  1. In jmorecfg.h, define BITS_IN_JSAMPLE as 12 rather than 8.
  2. In jconfig.h, undefine BMP_SUPPORTED, RLE_SUPPORTED, and TARGA_SUPPORTED,
     because the code for those formats doesn't handle 12-bit data and won't
     even compile.  (The PPM code does work, as explained below.  The GIF
     code works too; it scales 8-bit GIF data to and from 12-bit depth
     automatically.)
  3. Compile.  Don't expect "make test" to pass, since the supplied test
     files are for 8-bit data.

Currently, 12-bit support does not work on 16-bit-int machines.

Note that a 12-bit version will not read 8-bit JPEG files, nor vice versa;
so you'll want to keep around a regular 8-bit compilation as well.
(Run-time selection of data depth, to allow a single copy that does both,
is possible but would probably slow things down considerably; it's very low
on our to-do list.)
Project:
Temporarily lost at sea...
Plan:
World domination! Or something...


Return to “IRIX and Software”

Who is online

Users browsing this forum: Baidu [Spider] and 1 guest