RAW+JPEG WHERE??? HOW???

Posted 04/03/2008 - 07:55 Link
Lol, yeah I guess I'll admit it's technically possible - but it would require you to somehow reverse engineer your camera's internal code. (Pentax doesn't give it out to anyone, not even to the people who write the raw-conversion software for them) And then you'd have to write code to make the extracted data interface with some sort of image editing software, like photoshop. And then you'd have to write more code to save it back into an unconspicuous, ordinary-looking Raw file again, with all the metadata intact.

Even as a hobbyist, half-assed programmer I can tell you: that would be a ton of work even for a team of super-geniuses! Man, what a hassle that would be!

Anyone wanna fund me so I can begin development?
George Lazarette
Posted 04/03/2008 - 08:05 Link
A RAW file is not an uncompressed JPEG. Pentax RAW's are 12 bit, and JPEGs are 8.

G
Keywords: Charming, polite, and generally agreeable.
Clarky
Posted 04/03/2008 - 08:15 Link
Quote:
A RAW file is not an uncompressed JPEG. Pentax RAW's are 12 bit, and JPEGs are 8.

G
I stand corrected
Camera:|K-7|
Pentax Lenses:|DA12-24/f4 ED AL|DA35Ltd Macro|FA31Ltd|FA77Ltd|FA50/1.4|F70-210|FA20-35 f4/AL|A*200/f4 Macro ED|A50/1.7|A50 Macro f2.8|1.7xAF adapter|
Voigtlander|125/f2.5SL Macro APO Lanthar|
Sigma Lenses:|EX DG 100-300 f4|2X & 1.4X TC|
Flashes:|AF540FGZx2|RingFlash AF160FC|
Posted 04/03/2008 - 08:35 Link
Yeah, I heard this wonderful analogy for Raw files a while back.

Imagine a kitchen. The data in a Raw file is the ingredients(flour, milk, etc), the recipe book is the code within the camera, and the final image is the scrumptious cake we're making. Many people are fine letting their camera bake their cake for them (Shooting Jpgs), but some people prefer to modify the recipe ever so slightly(Editting raw files) to get their cake to taste a bit different. Sure you can modify a cake after it's been baked(playing with Jpgs), but it's not going to work as well as if you had modified the base ingredients or the recipe in the first place. There are less options for modification in the final cake.

One thing to keep in mind is, the recipe to bake this cake is a secret and only the head baker(the camera maker) knows what it is. Everyone else who is making this cake (any programs that can edit your camera's raw files) had to reverse-engineer that cake and guess the ingredients and recipe until it tasted about right.

Neat, huh?
johnriley
Posted 04/03/2008 - 08:41 Link
A curious analogy. As far as I know the only thing you can do with the ingredients mentioned is bake a cake. The only things you can do with a cake are store them until hard and disgusting (my grandmother useed to do this witrh Date and Walnut cake. I detest Date and Walnut cake) or eat them.

Not quite sure how this relates to photography!

Best regards, John
Clarky
Posted 04/03/2008 - 09:13 Link
Quote:
A curious analogy. As far as I know the only thing you can do with the ingredients mentioned is bake a cake. The only things you can do with a cake are store them until hard and disgusting (my grandmother useed to do this witrh Date and Walnut cake. I detest Date and Walnut cake) or eat them.

Not quite sure how this relates to photography!

Well if you have a photograph of your grandmother forcing you too eat it and the expression on your face. Then i would be interested
Camera:|K-7|
Pentax Lenses:|DA12-24/f4 ED AL|DA35Ltd Macro|FA31Ltd|FA77Ltd|FA50/1.4|F70-210|FA20-35 f4/AL|A*200/f4 Macro ED|A50/1.7|A50 Macro f2.8|1.7xAF adapter|
Voigtlander|125/f2.5SL Macro APO Lanthar|
Sigma Lenses:|EX DG 100-300 f4|2X & 1.4X TC|
Flashes:|AF540FGZx2|RingFlash AF160FC|
MattMatic
Posted 04/03/2008 - 09:36 Link
Quote:
Even as a hobbyist, half-assed programmer I can tell you: that would be a ton of work even for a team of super-geniuses! Man, what a hassle that would be!
Actually, not THAT difficult

All the code is contained in Dave Coffin's dcraw package. It's a single C file that is easily understood and contains pretty well all the RAW formats of every camera that ever was

You'll find it an education
http://cybercom.net/~dcoffin/dcraw/
http://en.wikipedia.org/wiki/Dcraw

Although the reassembly of image data back into a RAW file would be interesting, to say the least, the actual structure of the file and everything is contained within dcraw is pretty easy to follow.

You cannot, with absolute certainty, say that a RAW file is unedited. That's why some of the larger cameras include digital signature mechanisms within the camera (think Nikon do it in their top end) - the code creates a mathematical fingerprint within the camera that actually proves the image hasn't been altered at all (And it ain't cheap either!)

Matt
http://www.mattmatic.co.uk
(For gallery, tips and links)
vic cross
Posted 04/03/2008 - 10:48 Link
From little acorns mighty oak trees grow. I only wanted to know how and why. If someone asks the time you don't tell them how the clock works. CHEERS Vic
Born again biker with lots of Pentax bits. Every day I wake up is a good day. I'm so old I don't even buy green bananas.
MattMatic
Posted 04/03/2008 - 11:21 Link
Quote:
If someone asks the time you don't tell them how the clock works.
LOL!
Or how time works

Sorry to go off topic!
Matt
http://www.mattmatic.co.uk
(For gallery, tips and links)
vic cross
Posted 04/03/2008 - 11:41 Link
Hey Matt I wasn't having a go at any one. All the answers were good up to Drewski then it got complicated. TIME? SPACE? E=MC2 or something like that, but that is a whole other can of worms and nothing to do with RAW/JPEG Anyway I usually keep my User setting with RAW and my P setting on JPEG for normal shooting and A, S, M, for anything a bit special. Cheers Vic
Born again biker with lots of Pentax bits. Every day I wake up is a good day. I'm so old I don't even buy green bananas.
distudio
Posted 04/03/2008 - 11:44 Link
Quote:
A RAW file is not an uncompressed JPEG. Pentax RAW's are 12 bit, and JPEGs are 8.
Technically that's not quite correct, JPEG files are 24 bit, 8 bits of red, green and blue per pixel whereas a RAW file is 12 bits per pixel and a pixel corresponds to only one colour.

Getting back to the question can you alter a RAW file, yes it's possible but very difficult even with specialized software as I understand it the de-mosaicing/re-mosaicing algorithm is lossy, it's not an absolute conversion. I expect that any editing to alter content would need to be done in a full colour environment, if you've ever seen a RAW file displayed without de-mosaicing you'd appreciate why.
Posted 04/03/2008 - 17:48 Link
Quote:
All the answers were good up to Drewski then it got complicated. TIME? SPACE? E=MC2 or something like that
I'm glad I could help?

I didn't see the OP anywhere, so I thought I was all clear to go on about any old topic. Heh. Whoops. Hi OP, Welcome back!
Bob and his Pentax
Posted 04/03/2008 - 19:01 Link
Yes it is posible to edit RAW files using common software. I guess most people in this forum will already have programs that will do it loaded on there computers

If you shoot DNG then both Photoshop and Lightroom will allow you to edit the file and save as a DNG. There's other software which will do it too.

OK if you shoot the cameras 'native' RAW (eg a PEF) then there is less likely to be off the shelf software that will edit the raw file but lets not kid ourselfs that a good computer programmer could not given the file specs write out the apporpriate format file; and the file specs are out there because they must be known in order for the files to be read for conversion into JPG etc.

I don't think its possible to prove with 100% certainty that any digital picture is as shot.

Bob
Good luck

Bob

Pentax user since 1978, Digital since 1997.
Kit includes: K-7, K20D, K10D, *istDS, full set DA* lens, etc
George Lazarette
Posted 05/03/2008 - 19:18 Link
Quote:
George Lazarette wrote:
A RAW file is not an uncompressed JPEG. Pentax RAW's are 12 bit, and JPEGs are 8.
Technically that's not quite correct, JPEG files are 24 bit, 8 bits of red, green and blue per pixel whereas a RAW file is 12 bits per pixel and a pixel corresponds to only one colour.

Getting back to the question can you alter a RAW file, yes it's possible but very difficult even with specialized software as I understand it the de-mosaicing/re-mosaicing algorithm is lossy, it's not an absolute conversion. I expect that any editing to alter content would need to be done in a full colour environment, if you've ever seen a RAW file displayed without de-mosaicing you'd appreciate why.
I think you are in danger of confusing people, but it may be that I am confused myself.

Any one pixel can only represent one colour, so any one JPEG pixel has 8 bits of information about whichever colour is represented. A RAW pixel has 12 bits.

I think what you were trying to say was that all the pixels in a RAW image are pre-defined as being either red, green, or blue. JPEG pixels are not pre-defined, so in theory there are 24 bits of information that they could contain, of which only 8 will actually be contained.

Is that right?

G
Keywords: Charming, polite, and generally agreeable.
MattMatic
Posted 05/03/2008 - 21:51 Link
Quote:
Is that right?
No But it's a LOT more complicated than that

An RGB image (let's take a TIFF) has three bytes per colour, per pixel. So that's a total of 24-bits per pixel (8 red, 8 green, 8 blue).

However, a JPEG isn't that simple. It's actually split into a YCbCr - Luminance and two colour channels. The equation that mulches the RGB information into the YCbCr throws away most of the blue (takes only 11% IIRC). So JPEG can't contain that much information.

Added to that is the fact that the in-camera JPG came from the RAW data in the first place

And RAW is 12-bits per photo-site. Each photo-site is either R, G, or B. There are twice as many G as R or B. They're arranged in a square. The "missing" information is guessed by a demosaicing algorithm. This is done in camera for JPEG, or on PC for RAW.

Bottom line is that you have a LOT more info from RAW (at least 4 (EDIT:16) times as much, but more when you account for the loss of the blue channel). And the K20D has 14-bit RAW

Confused now?
Matt
http://www.mattmatic.co.uk
(For gallery, tips and links)

Add Comment

To leave a comment - Log in to Pentax User or create a new account.



Proudly supporting Pentax User

Samsung Logo Asahi Pentax Logo