Originally Posted by
revi
In theory there's no reason why you couldn't resize a RAW file the same way as any other image file type (perhaps with some restrictions). But for RAW files there's a few things that complicate it:
- The file is stored/read as (multiples of) 8-bit bytes, but RAW data is usually 12- or 14-bit, so either you limit yourself to cuts where byte bounds coincide with pixel bounds, or you'd have to decode (part of) your raw file
- A pixel in RAW data has only information for one colour, and to get the three base colours you'd have to make sure you work with squares of 4 pixels
- The metadata will have to be preserved intact, except for the image size information (which you change on cropping); but part of the meta-data information is in a manufacturer-specific (and usually unpublished) format. That makes writing to the meta-data rather dangerous: you run a chance that some of the decoders won't understand your modified RAW file any more, either because there's now contradictory information, or you messed up some of the data.
So cropping is already somewhat difficult. I'm not even sure resizing/resampling is possible without decoding the RAW data. But if you have to decode/demosaic the RAW data to do your resizing, why bother to re-encode in RAW (with all the extra errors that induces). Ad to that that some RAW formats are compressed (usually lossless compression), and the job really gets too complicated to be useful