JPG Image Size

D
Posted By
Dan
Sep 29, 2004
Views
435
Replies
2
Status
Closed
I am trying to figure out how to read the image size (as given by Photoshop) in a jpg. I got the specification and learned there is a field SOFO (Start of Frame 0) Marker. It shows the following break down for the field:

<————

Marker Identifier 2 bytes 0xff, 0xc0 to identify SOFO marker

Length 2 bytes This value equals to 8 + components * 3 value

Data precision 1 bytes This is in bits/sample, usually 8

(12 and 16 not supported by most software)

Image Height 2 bytes This must be > 0

Image Width 2 bytes This must be > 0

Number of components 1 byte Usually 1=grey scaled, 3=color YcbCr or YIQ 4=color CMYK

Each component 3 bytes Read each component data of 3 bytes.

————–>

I have a small jpg picture that is 83 high by 125 wide. The "Image Height" field in the jpg for the SOFO group says 174h or 372 and the width field says 234h or 564 and that doesn’t make sense. I am trying my best to figure out how they get those numbers. Does anyone know how this works or could you point me in the right direction?

Thank you for any help you can provide

MacBook Pro 16” Mockups 🔥

– in 4 materials (clay versions included)

– 12 scenes

– 48 MacBook Pro 16″ mockups

– 6000 x 4500 px

B
bogus
Sep 29, 2004
If Photoshop says the image is 83 pixels high by 125 pixels high, that is the size.

Now, if you are printing the image you have to look at how many pixels per inch the image is set to. An image that is set to print at 72 dpi (typical screen resolution) will be about 3 time larger than an image set to 300 dpi (typical print resolution).

Dan wrote:
I am trying to figure out how to read the image size (as given by Photoshop) in a jpg. I got the specification and learned there is a field SOFO (Start of Frame 0) Marker. It shows the following break down for the field:
<————

Marker Identifier 2 bytes 0xff, 0xc0 to identify SOFO marker
Length 2 bytes This value equals to 8 + components * 3 value
Data precision 1 bytes This is in bits/sample, usually 8
(12 and 16 not supported by most software)

Image Height 2 bytes This must be > 0

Image Width 2 bytes This must be > 0

Number of components 1 byte Usually 1=grey scaled, 3=color YcbCr or YIQ 4=color CMYK

Each component 3 bytes Read each component data of 3 bytes.
————–>

I have a small jpg picture that is 83 high by 125 wide. The "Image Height" field in the jpg for the SOFO group says 174h or 372 and the width field says 234h or 564 and that doesn’t make sense. I am trying my best to figure out how they get those numbers. Does anyone know how this works or could you point me in the right direction?

Thank you for any help you can provide

M
mmm
Sep 30, 2004
You don’t say what the other fields are in your sample.
A little math gives
372 = 40 + 4*83
564 = 64 + 4*125
If the number of components is 4 then there may be some additional information in the matrix accounting for the 40 and 64 overhead. Try with another sample to see if you can resolve the math. Perhaps also, double check your offsets.
Have you looked at documentation at www.jpeg.org?
You may find the details there somewhere.

Dan wrote:
I am trying to figure out how to read the image size (as given by Photoshop) in a jpg. I got the specification and learned there is a field SOFO (Start of Frame 0) Marker. It shows the following break down for the field:
<————

Marker Identifier 2 bytes 0xff, 0xc0 to identify SOFO marker
Length 2 bytes This value equals to 8 + components * 3 value
Data precision 1 bytes This is in bits/sample, usually 8
(12 and 16 not supported by most software)

Image Height 2 bytes This must be > 0

Image Width 2 bytes This must be > 0

Number of components 1 byte Usually 1=grey scaled, 3=color YcbCr or YIQ 4=color CMYK

Each component 3 bytes Read each component data of 3 bytes.
————–>

I have a small jpg picture that is 83 high by 125 wide. The "Image Height" field in the jpg for the SOFO group says 174h or 372 and the width field says 234h or 564 and that doesn’t make sense. I am trying my best to figure out how they get those numbers. Does anyone know how this works or could you point me in the right direction?

Thank you for any help you can provide

How to Master Sharpening in Photoshop

Give your photos a professional finish with sharpening in Photoshop. Learn to enhance details, create contrast, and prepare your images for print, web, and social media.

Related Discussion Topics

Nice and short text about related topics in discussion sections