PSD to JPEG whats going on?

-Paul-

Suspended / Banned
Messages
1,401
Name
Paul.
Edit My Images
Yes
I'll try and ask this question as simply as possible because I have no idea whats going on! So
Please bear with me.... Here goes, I am using photoshop to create a montage for one of the parents in my sons rugby league club. What they want is a team picture in the middle with pictures of their son around the outside. Now I think that psd files are bigger than jpeg's not sure why (?) But anyway thats another question. What I want to know is if the team picture by itself is lets say 200 kbs and lets say one of the surrounding pictures is lets say another 200kbs before I blend them together is photoshop. I would have thought that once I have finished merging them together in photoshop and saved them to a jpeg file they would total 400kbs but for some reason this appears not to be the case it is less than the expected total and If someone could tell me why it would stop me losing what little hair I have left! In som e cases it gets even more confusing because I I use a mask it alters the the total yet again to either a greater or lesser degree depending on which picture I use the mask on!
Please if someone could explain this to me I would be very grateful.
Thanks for any help guys and gals.
 
Two things.. when you say PSDs are bigger than JPEGs are you meaning in file size, or resolution? JPEGs will always be smaller in file size because they are compressed, and contain less detail.

If you are making the montage/set out of PSDs then of course the final will be smaller when it's saved as a JPEG. That's the point of JPEG - compression to make the file size smaller. The pay off is quality.
 
I think you need to understand the difference between file sizes and image sizes.

An image for example may come from a 6Mpixel camera but requires 3 bytes for every pixel; one for Red, one for Green and one for Blue.

So while you have 6Mpixels in this simplistic example there is actually 18Mbytes of data.

Jpeg files are compressed files - similar to the audio equivalent of MP3. Information is cleverly processed and discarded to provide a file that requires less than the original number of bytes required for the image pixels. This is the compression process that's talked about.

The amount of compression is variable with maximum compression often resulting in a lower quality image. Minimum compression still saves a lot of bytes but keeps image quality high.

For the 6Mpixel example a high quality (low compression) image would be about 3.66Mbytes - compared to the 18Mbytes dictated by the pixel dimensions.

When you open up a JPEG file in Photoshop it still produces the original image of 6Mpixels or 18Mbytes of RGB data - coming from the 3.66Mbyte file.

Since PSD files are not compressed ( and called lossless because no information is discarded), when you come to save it the file size would be in the region of 18Mbytes for a 6Mpixel image.

As you add other smaller file size jpegs they also get expanded into the number of Mbytes needed for the original pixels so the resultant composite file size gets larger and larger but not strictly in proportion to the JPEG file sizes.

In fact two layers of images each of 6MPixels or approx 18Mbytes each can produce a PSD file of over 50Mbytes.

Hope this helps

Colin
 
Thanks guys, I'am still not sure what you mean! Iunderstand that jpeg files are smaller than psd files. I also know about jpegs being compressed but what I cant get my head around is that if you have two individual jpeg files of lets say 400kbs each open them both in photoshop, dont alter them in any way, put them in the same file then save them as a jpeg file I would think it would be an 800kbs file but thisd doesn't seem to be the case?
 
Thanks guys, I'am still not sure what you mean! Iunderstand that jpeg files are smaller than psd files. I also know about jpegs being compressed but what I cant get my head around is that if you have two individual jpeg files of lets say 400kbs each open them both in photoshop, dont alter them in any way, put them in the same file then save them as a jpeg file I would think it would be an 800kbs file but thisd doesn't seem to be the case?

When you save something as a JPEG it:
1 splits the image into blocks
2 performs a discrete cosine transform on the block.

This removes the high frequency info from the image (the fine details - it's like adding a slight blur filter) controlled by the quality setting. Too much and you also start to see the blocks.

In your case, you've taken 2 images, added JPEG compression. Decoded them to uncompressed to work on them and added more JPEG compression. You've removed more fine detail in the second compression so it will be smaller.
 
The amount of compression depends on the image content.

If you had an image of just two colour blocks and saved this as a JPEG it would compress down very small because its easy to represent the two colour blocks in just a few bytes of information

If you then had the same size image which has lots of detail and lots of colour changes, then saving this as a JPEG would require more bytes of information than the previous example.

When you make your composite image from two JPEG files, in photoshop this will actually be many Mbytes of data that it needs to handle. Remember file size is not the same as image size.

Your composite image may now be more or less complex in terms of colour data and detail and so the resulting JPEG file that you save may very well be different from the sum of the two because the amount of compression may change.

Colin
 
You have a 24MPix photo.... ; this is the IMAGE SIZE, and it is NOT always directly related to the FILE SIZE its created from, in terms of the bytes of memory used to store the image data, on disc or in memory or anything..

Image Size: 6000 pixels by 4000 pixels; that defines the 'Hard-Frame'... simplistic analogy.... like, a card-board box, 10cm x 15cm x 20cm = 3000cm3 or 3 liters.

Now... what is in the box doesn't matter... the box will take up 3l of space regardless, wont it?

File Size: Lets get Play-School; We have 3.0l box. We we can put a single marble in it, or a brick... doesn't matter how 'big' of how 'heavy' what we put in it is.... the BOX will always be the same size, right?

OK.... so empty box.... full of air. Weighs a few grams. Lets half fill it with gravel; it now weighs a few Kilograms. BOX is the same SIZE, but its now a heck of a lot heavier.

Marbles and Bricks. We have a box, 20cm by 15cm by 10 cm. Its only just big enough to fit one house-brick in it, but you could probably fit 2oo marbles in there. How 'much' stuff you can get in the box depends on how it fits together and how much free-space is around the stuff you try and squash in, doesn't it?

If you try fitting in big lumps of gravel, chances are that you wont be able to pack as much 'weight' of gravel in the box, as if you have smaller gravel chippings.

So, 6000x4000 pixel IMAGE... how 'heavy' that 'box', how many maga-bytes of FILE size it takes up, is depends on what you fill it with.

OK.... so lets apply 'COMPRESSION'.

Our card-board box is a bit inconvenient, its inflexible restrictive shape, takes up space irrespective of what we stick in it, and we'd like to pack stuff down a bit.... lets use a flexible plastic bag instead. Same 3.0l capacity.. only now it can change shape a bit, and can work really well, if teh stuff you stick in it can change shape a bit too.

Unfortunately marbles and bricks are rather rigid and wont play ball so well, but, if we have soft squashy stuff, like cloths or duvets or grass-clippings, we can stuff the back choka-block, and then sit on it, and squash out all the air, to make it smaller.

Our nominal 3.0l container, might get stretched to get the stuff in it in the first place, but can be shrunk down quite a bit before we pack it away.

So the FILE SIZE, is dependent on the IMAGE SIZE then on the image content, and then on how much COMRESSION is or isn't appllied to it.

OK... Combining Images.

24Mega-Pizel IMAGE size. Fixed frame, lets ignore file size, and ignore compression. And you have TWO of them.

You open them up in a photo-editor and merge them into one NEW image.

How big that image is going to be STILL depends on the frame size you set for it.

You can merge pictures by Pixel ADDITION or you can merge pictures by Pixel SUBSTITUTION, or by a combination of both.

Pixel Substitution. You take Image 1; 6000x4000 pixels. You then take Image 2, and you cut either the whole image or a number of pixels from it as a crop, and then past them IN to Image 1. Image 1 has NOT changes size, and the only way to put those new pixels from the second picture into it, is to take away ones that were there to begin with.

EG: You have photo of Taj-Mahal, and you want to photo-shop Granny who'se never been anywhere more exotic than Bognor infront of it.

You take your 6000x4000 picture of the Taj-Mahal, you take your 6000x4000 picture of Granny, you then cut out the pixels defining Granny in that image, and past the OVER the ones in the picture of the Taj Mahal.

New image, within the frame of the original Taj picture is still 6000x4000 pixels, content has changed, though so even at the same compression level, there is likely to be a small 'weight' difference, due to the different content, BUT overall IMAGE size is the same, you have merged by substitution.

Pixel Addition: To merge two pictures, rather than swapping pixels from one to the other... you add them. Best example is a Panorama-Stitch.

You have looked at a wide vista; and unable to fit it all in your viewfinder at the same time, you take two pictures. One to left of center, one to right of center

Both are 6000x400 pixels image size, but because the content is different, chances are the file-size will be different to.

Line them up side by side like two post-cards, you get a new IMAGE size, 12,000 x 4000 pixels... probably with a horrible band where they join.

In thoery, exactly twice the pixels, and the self same pixels that were in the original images, the FILE size ought to be exactly the sum of the that for the two individual pictures. BUT all digital images, like the card-board box, have some invisible packaging. Card-board adds maybe 0.5mm to the overall size of the content; so a digital image, has some 'packaging data' adding to the file size; good example is the EXIF date and file tags that you can open up seperately to find out about the image.

Your two individual files have thier own packaging; open them up, put them both into one box, and well, chances are you might get away with a bit less packaging, and certainly you only need one 'lable' so its likely that the 'sum' of the two parts is actually a tad less than the sum of the individual parts... though could be more.

But lets look at that horrible join line between pictures:

STITCHING: Stitching, uses 'some' substitution and sum addition to make new image. Over-Lapping the individual 'frames' gives you something in the image to index on and line up one image over the other to over-lap, hopefully getting rid of that join line between the two, and ensuring that the new image flows seamlessly from one side of the new frame to the other.

Two 6000x4000 images; overlapping by what, 30% 2000 pixels; you get full width of first image 6000 pixels, then the 2/3 or 4000 pixels of the second that aren;t the same as the last third of the first. Put them together, you get a new image frame, 10,000x4000 pixels; part substitution, part addition.

SO.... the FILE SIZE of any image, is only loosely related to the IMAGE SIZE, by way of the pixel frame, the content density, and then applied compression.

When Merging Photos to make a new one; the 'new' file size, will again, still be dependent on the pixel frame, content denisty and applied compression.

If you dont increase the pixel frame size, (Substitution Merge) to include the new content; then it wont make a big difference to the file size, which will only be effected by change in content density and any applied compression.

If you increase the pixel frame to include new content (Addition Merge), then the file size is likely to be increased a lot more dramatically, and in loose proportion to the increase in pixel count. BUT still effected by content density and applied compression.

Analogy is, card-board boxes and plastic bags, bricks, gravel grass and duvets.

Things have different sizes, different weights and different volumes, and you are packaging them all up, in quite a complicated manner, where direct liniar relationships rarely follow simple logic.

BUT, Pixels and Bytes are like Liters and Kilograms; totally different commodities, and NOT directly proportional to one another.

One liter of water may weigh One kilogram, but one liter of air will doesn't, it's a lot lighter, and one might be squashed a lot more than the other.
 
Back
Top