BorlandTalk.com Forum Index BorlandTalk.com
Borland discussion newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

RAW graphics format

 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi Graphics
View previous topic :: View next topic  
Author Message
Francesco Savastano
Guest





PostPosted: Wed Apr 21, 2004 3:50 pm    Post subject: RAW graphics format Reply with quote



Anyone knows of some component/library that can read RAW graphics format?
Thx for any suggestion.

--
New World Software
Creative Tools for Creative People
http://new-world-software.com


Back to top
Charles Hacker
Guest





PostPosted: Thu Apr 22, 2004 6:27 am    Post subject: Re: RAW graphics format Reply with quote



Francesco Savastano wrote:
Quote:

Anyone knows of some component/library that can read RAW graphics format?
Thx for any suggestion.

It depends on what is really the RAW setting.
Is it that the graphic data is stored in the RAW (RGB colour) values, or
is the RAW format some form of graphics encoding type?

In any case, you will need to know the actual format of the stored data
values.

When you do know the format, it is easy enough to load these RAW values
in (to say a RGB 24 bit) to bitmap.

--
Charles Hacker
Lecturer in Electronics and Computing
School of Engineering
Griffith University - Gold Coast
Australia

Back to top
Francesco Savastano
Guest





PostPosted: Thu Apr 22, 2004 8:59 am    Post subject: Re: RAW graphics format Reply with quote



To be honest, i dont have many clues on how the format is (i nnever saw
myself a picture in this format): i was encharged to find a component to
load such format by my employer. It should be a format related to digital
cameras, i think.

--
New World Software
Creative Tools for Creative People
http://new-world-software.com
"Charles Hacker" <reply.to (AT) borland (DOT) newsgroups> ha scritto nel messaggio
news:408765C7.CC385B9A (AT) borland (DOT) newsgroups...
Quote:
Francesco Savastano wrote:

Anyone knows of some component/library that can read RAW graphics
format?
Thx for any suggestion.

It depends on what is really the RAW setting.
Is it that the graphic data is stored in the RAW (RGB colour) values, or
is the RAW format some form of graphics encoding type?

In any case, you will need to know the actual format of the stored data
values.

When you do know the format, it is easy enough to load these RAW values
in (to say a RGB 24 bit) to bitmap.

--
Charles Hacker
Lecturer in Electronics and Computing
School of Engineering
Griffith University - Gold Coast
Australia



Back to top
Michael Hansen
Guest





PostPosted: Thu Apr 22, 2004 10:24 am    Post subject: Re: RAW graphics format Reply with quote

Raw formats typically only contains raw, uncompressed pixel data. As far as
I know the raw format does not have a specific structure, some uses a header
that contains width, height and depth, others do not e.g. because they only
write a specific size and depth all the time.
If you look at the raw importer in photoshop, this very much explains the
method: show a dialog where the user can type in the width, height,
colordepth, amount of channels, eventual headersize (used as offset to where
the raw data starts). With these parameters given, all you have to do is
setup a file structure and blockread the file.

You might refer to a specific raw format used by some cameraīs etc., if so,
you have to find the specific header information somewhere (I guess the
camera producerīs site is a good place to start).


Regards,

Michael Hansen


Back to top
Francesco Savastano
Guest





PostPosted: Thu Apr 22, 2004 10:33 am    Post subject: Re: RAW graphics format Reply with quote

Hello Michael, thanx for the answer. I will investigate more on the
specifics of Raw data format we might want to support.

--
New World Software
Creative Tools for Creative People
http://new-world-software.com
"Michael Hansen" <dyster_tid (AT) hotmail (DOT) com> ha scritto nel messaggio
news:40879d53 (AT) newsgroups (DOT) borland.com...
Quote:
Raw formats typically only contains raw, uncompressed pixel data. As far
as
I know the raw format does not have a specific structure, some uses a
header
that contains width, height and depth, others do not e.g. because they
only
write a specific size and depth all the time.
If you look at the raw importer in photoshop, this very much explains the
method: show a dialog where the user can type in the width, height,
colordepth, amount of channels, eventual headersize (used as offset to
where
the raw data starts). With these parameters given, all you have to do is
setup a file structure and blockread the file.

You might refer to a specific raw format used by some cameraīs etc., if
so,
you have to find the specific header information somewhere (I guess the
camera producerīs site is a good place to start).


Regards,

Michael Hansen





Back to top
Emi
Guest





PostPosted: Thu Apr 22, 2004 3:46 pm    Post subject: Re: RAW graphics format Reply with quote

You should just go ahead and write the code to open the file and read it.
Read 3 bytes per pixel (RGB) and just draw it.
If you don't have the width & height info, make it up. You'll see the
distorted image, but the colors will "make sense". If you see too much
"noise" (that is, lots of mixed colours, and nothing "smooth"), you will
realize that you're dealing with a different image depth than 24bits per
pixel, if you do, you will have to try it with other depths... Also, you
can then try to read the first 4 bytes as an integer to see if its the width
and then read the height, and check if they make sense. try it...

"Francesco Savastano" <francosavaTogli (AT) Nospamlibero (DOT) it> wrote

Quote:
Hello Michael, thanx for the answer. I will investigate more on the
specifics of Raw data format we might want to support.

--
New World Software
Creative Tools for Creative People
http://new-world-software.com
"Michael Hansen" <dyster_tid (AT) hotmail (DOT) com> ha scritto nel messaggio
news:40879d53 (AT) newsgroups (DOT) borland.com...
Raw formats typically only contains raw, uncompressed pixel data. As far
as
I know the raw format does not have a specific structure, some uses a
header
that contains width, height and depth, others do not e.g. because they
only
write a specific size and depth all the time.
If you look at the raw importer in photoshop, this very much explains
the
method: show a dialog where the user can type in the width, height,
colordepth, amount of channels, eventual headersize (used as offset to
where
the raw data starts). With these parameters given, all you have to do is
setup a file structure and blockread the file.

You might refer to a specific raw format used by some cameraīs etc., if
so,
you have to find the specific header information somewhere (I guess the
camera producerīs site is a good place to start).


Regards,

Michael Hansen







Back to top
Emi
Guest





PostPosted: Thu Apr 22, 2004 3:54 pm    Post subject: Re: RAW graphics format Reply with quote

Also, some formats (like .CEL) have palette information in the header if
they are indexed images.
It's hard to find out, unless you have the application that generated the
file, and generate the image yourself.

"Emi" <emisosa_dot_hotmail_dot_com> wrote

Quote:
You should just go ahead and write the code to open the file and read it.
Read 3 bytes per pixel (RGB) and just draw it.
If you don't have the width & height info, make it up. You'll see the
distorted image, but the colors will "make sense". If you see too much
"noise" (that is, lots of mixed colours, and nothing "smooth"), you will
realize that you're dealing with a different image depth than 24bits per
pixel, if you do, you will have to try it with other depths... Also, you
can then try to read the first 4 bytes as an integer to see if its the
width
and then read the height, and check if they make sense. try it...

"Francesco Savastano" <francosavaTogli (AT) Nospamlibero (DOT) it> wrote in message
news:40879f80 (AT) newsgroups (DOT) borland.com...
Hello Michael, thanx for the answer. I will investigate more on the
specifics of Raw data format we might want to support.

--
New World Software
Creative Tools for Creative People
http://new-world-software.com
"Michael Hansen" <dyster_tid (AT) hotmail (DOT) com> ha scritto nel messaggio
news:40879d53 (AT) newsgroups (DOT) borland.com...
Raw formats typically only contains raw, uncompressed pixel data. As
far
as
I know the raw format does not have a specific structure, some uses a
header
that contains width, height and depth, others do not e.g. because they
only
write a specific size and depth all the time.
If you look at the raw importer in photoshop, this very much explains
the
method: show a dialog where the user can type in the width, height,
colordepth, amount of channels, eventual headersize (used as offset to
where
the raw data starts). With these parameters given, all you have to do
is
setup a file structure and blockread the file.

You might refer to a specific raw format used by some cameraīs etc.,
if
so,
you have to find the specific header information somewhere (I guess
the
camera producerīs site is a good place to start).


Regards,

Michael Hansen









Back to top
Francesco Savastano
Guest





PostPosted: Thu Apr 22, 2004 5:04 pm    Post subject: Re: RAW graphics format Reply with quote

But i read that some (or many?) cameras use only 12 bits per pixels in this
format, is it true? If it's so the assumption of 24 bits appears remote
here. Do you know anything about it?

As reference i found this:
http://www.dpreview.com/learn/?/Glossary/Digital_Imaging/RAW_Image_Format_01.htm

I am also aware of a plugin for photoshop, i found it here:
http://vrm.vrway.com/vartist/VR_industry/PHOTOSHOP_7_CAMERA_RAW_FORMAT_JPEG_2000_PLUG-IN.html

--
New World Software
Creative Tools for Creative People
http://new-world-software.com
"Emi" <emisosa_dot_hotmail_dot_com> ha scritto nel messaggio
news:4087e815 (AT) newsgroups (DOT) borland.com...
Quote:
You should just go ahead and write the code to open the file and read it.
Read 3 bytes per pixel (RGB) and just draw it.
If you don't have the width & height info, make it up. You'll see the
distorted image, but the colors will "make sense". If you see too much
"noise" (that is, lots of mixed colours, and nothing "smooth"), you will
realize that you're dealing with a different image depth than 24bits per
pixel, if you do, you will have to try it with other depths... Also, you
can then try to read the first 4 bytes as an integer to see if its the
width
and then read the height, and check if they make sense. try it...

"Francesco Savastano" <francosavaTogli (AT) Nospamlibero (DOT) it> wrote in message
news:40879f80 (AT) newsgroups (DOT) borland.com...
Hello Michael, thanx for the answer. I will investigate more on the
specifics of Raw data format we might want to support.

--
New World Software
Creative Tools for Creative People
http://new-world-software.com
"Michael Hansen" <dyster_tid (AT) hotmail (DOT) com> ha scritto nel messaggio
news:40879d53 (AT) newsgroups (DOT) borland.com...
Raw formats typically only contains raw, uncompressed pixel data. As
far
as
I know the raw format does not have a specific structure, some uses a
header
that contains width, height and depth, others do not e.g. because they
only
write a specific size and depth all the time.
If you look at the raw importer in photoshop, this very much explains
the
method: show a dialog where the user can type in the width, height,
colordepth, amount of channels, eventual headersize (used as offset to
where
the raw data starts). With these parameters given, all you have to do
is
setup a file structure and blockread the file.

You might refer to a specific raw format used by some cameraīs etc.,
if
so,
you have to find the specific header information somewhere (I guess
the
camera producerīs site is a good place to start).


Regards,

Michael Hansen









Back to top
Nils Haeck
Guest





PostPosted: Thu Apr 22, 2004 10:42 pm    Post subject: Re: RAW graphics format Reply with quote

He meant 24 bits in total. 12 bits per channel translates to 12x3 = 36 bits.

Reverse-engineering your format can be tricky. Especially if it is a "RAW"
format for a digicam. A guy named Dave Coffin actually has
reverse-engineered a lot of raw formats, like Canon CRW, Nikon NEF and a
bunch of others.

I can help you with the Canon CRW format, since I transcoded that from C++
to Delphi. If you can, post a sample in the attachments group or send it to
me by email if it is sensitive (so I can go and publish it in the
newspaper - sorry just joking Smile ).

Kind regards,

Nils Haeck
www.simdesign.nl

"Francesco Savastano" <francosavaTogli (AT) Nospamlibero (DOT) it> wrote

Quote:
But i read that some (or many?) cameras use only 12 bits per pixels in
this
format, is it true? If it's so the assumption of 24 bits appears remote
here. Do you know anything about it?

As reference i found this:

http://www.dpreview.com/learn/?/Glossary/Digital_Imaging/RAW_Image_Format_01.htm

I am also aware of a plugin for photoshop, i found it here:

http://vrm.vrway.com/vartist/VR_industry/PHOTOSHOP_7_CAMERA_RAW_FORMAT_JPEG_2000_PLUG-IN.html

--
New World Software
Creative Tools for Creative People
http://new-world-software.com
"Emi" <emisosa_dot_hotmail_dot_com> ha scritto nel messaggio
news:4087e815 (AT) newsgroups (DOT) borland.com...
You should just go ahead and write the code to open the file and read
it.
Read 3 bytes per pixel (RGB) and just draw it.
If you don't have the width & height info, make it up. You'll see the
distorted image, but the colors will "make sense". If you see too much
"noise" (that is, lots of mixed colours, and nothing "smooth"), you will
realize that you're dealing with a different image depth than 24bits per
pixel, if you do, you will have to try it with other depths... Also,
you
can then try to read the first 4 bytes as an integer to see if its the
width
and then read the height, and check if they make sense. try it...

"Francesco Savastano" <francosavaTogli (AT) Nospamlibero (DOT) it> wrote in message
news:40879f80 (AT) newsgroups (DOT) borland.com...
Hello Michael, thanx for the answer. I will investigate more on the
specifics of Raw data format we might want to support.

--
New World Software
Creative Tools for Creative People
http://new-world-software.com
"Michael Hansen" <dyster_tid (AT) hotmail (DOT) com> ha scritto nel messaggio
news:40879d53 (AT) newsgroups (DOT) borland.com...
Raw formats typically only contains raw, uncompressed pixel data. As
far
as
I know the raw format does not have a specific structure, some uses
a
header
that contains width, height and depth, others do not e.g. because
they
only
write a specific size and depth all the time.
If you look at the raw importer in photoshop, this very much
explains
the
method: show a dialog where the user can type in the width, height,
colordepth, amount of channels, eventual headersize (used as offset
to
where
the raw data starts). With these parameters given, all you have to
do
is
setup a file structure and blockread the file.

You might refer to a specific raw format used by some cameraīs etc.,
if
so,
you have to find the specific header information somewhere (I guess
the
camera producerīs site is a good place to start).


Regards,

Michael Hansen











Back to top
Matthias Matting
Guest





PostPosted: Fri Apr 23, 2004 8:46 am    Post subject: Re: RAW graphics format Reply with quote

Quote:
Anyone knows of some component/library that can read RAW graphics format?

You can use the GFL-SDK from XNView
([url]http://perso.wanadoo.fr/pierre.g/xnview/engfl.html)[/url]. It knows several RAW
formats, for instance those by Canon and Nikon. It is a DLL but already has
a Delphi interface. If you're interested, I made a TPicture descendant that
actually uses the GFL-SDK to load images.

Regards
Matthias



Back to top
Francesco Savastano
Guest





PostPosted: Fri Apr 23, 2004 9:30 am    Post subject: Re: RAW graphics format Reply with quote

Nils, if you read the article in the reference of my previous post, it says
clearly that RAW uses 8,10 or 12 bits per pixel (not per channel), is it a
mistake? it would seem very strange that a camera is able to retrieve 24bits
bitmaps from only 12bits RAW data. But the article confirms that RAW data
are lighter than the final RGB Data, because of the inferior bits per pixel
sampling.

--
New World Software
Creative Tools for Creative People
http://new-world-software.com
"Nils Haeck" <n.haeckno (AT) spamchello (DOT) nl> ha scritto nel messaggio
news:408847ea$1 (AT) newsgroups (DOT) borland.com...
Quote:
He meant 24 bits in total. 12 bits per channel translates to 12x3 = 36
bits.

Reverse-engineering your format can be tricky. Especially if it is a "RAW"
format for a digicam. A guy named Dave Coffin actually has
reverse-engineered a lot of raw formats, like Canon CRW, Nikon NEF and a
bunch of others.

I can help you with the Canon CRW format, since I transcoded that from C++
to Delphi. If you can, post a sample in the attachments group or send it
to
me by email if it is sensitive (so I can go and publish it in the
newspaper - sorry just joking Smile ).

Kind regards,

Nils Haeck
www.simdesign.nl

"Francesco Savastano" <francosavaTogli (AT) Nospamlibero (DOT) it> wrote in message
news:4087fb02 (AT) newsgroups (DOT) borland.com...
But i read that some (or many?) cameras use only 12 bits per pixels in
this
format, is it true? If it's so the assumption of 24 bits appears remote
here. Do you know anything about it?

As reference i found this:


http://www.dpreview.com/learn/?/Glossary/Digital_Imaging/RAW_Image_Format_01.htm

I am also aware of a plugin for photoshop, i found it here:


http://vrm.vrway.com/vartist/VR_industry/PHOTOSHOP_7_CAMERA_RAW_FORMAT_JPEG_2000_PLUG-IN.html

--
New World Software
Creative Tools for Creative People
http://new-world-software.com
"Emi" <emisosa_dot_hotmail_dot_com> ha scritto nel messaggio
news:4087e815 (AT) newsgroups (DOT) borland.com...
You should just go ahead and write the code to open the file and read
it.
Read 3 bytes per pixel (RGB) and just draw it.
If you don't have the width & height info, make it up. You'll see the
distorted image, but the colors will "make sense". If you see too much
"noise" (that is, lots of mixed colours, and nothing "smooth"), you
will
realize that you're dealing with a different image depth than 24bits
per
pixel, if you do, you will have to try it with other depths... Also,
you
can then try to read the first 4 bytes as an integer to see if its the
width
and then read the height, and check if they make sense. try it...

"Francesco Savastano" <francosavaTogli (AT) Nospamlibero (DOT) it> wrote in
message
news:40879f80 (AT) newsgroups (DOT) borland.com...
Hello Michael, thanx for the answer. I will investigate more on the
specifics of Raw data format we might want to support.

--
New World Software
Creative Tools for Creative People
http://new-world-software.com
"Michael Hansen" <dyster_tid (AT) hotmail (DOT) com> ha scritto nel messaggio
news:40879d53 (AT) newsgroups (DOT) borland.com...
Raw formats typically only contains raw, uncompressed pixel data.
As
far
as
I know the raw format does not have a specific structure, some
uses
a
header
that contains width, height and depth, others do not e.g. because
they
only
write a specific size and depth all the time.
If you look at the raw importer in photoshop, this very much
explains
the
method: show a dialog where the user can type in the width,
height,
colordepth, amount of channels, eventual headersize (used as
offset
to
where
the raw data starts). With these parameters given, all you have to
do
is
setup a file structure and blockread the file.

You might refer to a specific raw format used by some cameraīs
etc.,
if
so,
you have to find the specific header information somewhere (I
guess
the
camera producerīs site is a good place to start).


Regards,

Michael Hansen













Back to top
Francesco Savastano
Guest





PostPosted: Fri Apr 23, 2004 9:35 am    Post subject: Re: RAW graphics format Reply with quote

Hello Matthias,
Thanx for the link, i would be really interested in your TPicture component,
can you post in the attachments or send it to me at [email]francosava (AT) libero (DOT) it[/email] ,
Francesco.


--
New World Software
Creative Tools for Creative People
http://new-world-software.com
"Matthias Matting" <matting (AT) matting (DOT) de> ha scritto nel messaggio
news:4088d8f8 (AT) newsgroups (DOT) borland.com...
Quote:
Anyone knows of some component/library that can read RAW graphics
format?

You can use the GFL-SDK from XNView
([url]http://perso.wanadoo.fr/pierre.g/xnview/engfl.html)[/url]. It knows several RAW
formats, for instance those by Canon and Nikon. It is a DLL but already
has
a Delphi interface. If you're interested, I made a TPicture descendant
that
actually uses the GFL-SDK to load images.

Regards
Matthias





Back to top
Nils Haeck
Guest





PostPosted: Fri Apr 23, 2004 1:04 pm    Post subject: Re: RAW graphics format Reply with quote

Quote:
Nils, if you read the article in the reference of my previous post, it
says
clearly that RAW uses 8,10 or 12 bits per pixel (not per channel), is it a

RAW is just a general name for all formats that are somehow storing raw
information captured from the sensor. In my opinion, this is slightly moving
from lower to higher bit numbers. Modern cameras often store info at 10 - 12
bits per *channel*. Some cameras (Canon) store this in CMYK format (instead
of RGB).

The way the information is stored is not disclosed in the RAW format,
therefore, it is impossible to build one generic RAW reader. It really
depends on which program created the RAW file.

Kind regards,

Nils



Back to top
Matthias Matting
Guest





PostPosted: Tue Apr 27, 2004 9:23 pm    Post subject: Re: RAW graphics format Reply with quote

Hi,

Quote:
i would be really interested in your TPicture component,

It's online at
http://www.editorix.org/congo/html/delphi_components.html

But it's very simple, really :)

If you want TPicture to automatically load your formats, you have to add
this to initialization section:

TPicture.RegisterFileFormat('ext', MyFormat', TGflPic);
....
finalization
TPicture.UnregisterGraphicClass(TGflPic);

Regards Smile
Matthias



Back to top
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi Graphics All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.