Luminous Landscape Forum

Raw & Post Processing, Printing => Digital Image Processing => Topic started by: aaronchan on August 31, 2017, 05:07:51 am

Title: I'm stuck in a very stupid situation, Please help!
Post by: aaronchan on August 31, 2017, 05:07:51 am
Dear all,

I'm trying to submit a photo contest online.
Since I have to upload the image on their website, there are some rules for the image files:
File has to be between 5-10MB
File has to be in JPG

OK, so one of my pictures has a huge white background,
after converting it to JPG, it only has 2.9MB. (included sRGB icc profile)
But it's already 4000x5000 pixel.

I have contacted the CS of this contest and they said I will need to mainipulate the file size in some way........

Is there anyway to increase the file size but not effect my image itself?


Thanks
Aaron
Title: Re: I'm stuck in a very stupid situation, Please help!
Post by: Otto Phocus on August 31, 2017, 05:44:54 am
Good luck with this, I did not know that having an image that was too small would be a concern.

I am interested in learning the solution to this problem also.
Title: Re: I'm stuck in a very stupid situation, Please help!
Post by: francois on August 31, 2017, 06:07:15 am
I may not understand the issue but if you only need to increase the file size, then crank up the JPEG compression quality when you convert to JPEG (something like 85% in Photoshop).
Title: Re: I'm stuck in a very stupid situation, Please help!
Post by: kers on August 31, 2017, 06:21:58 am
the white background is easy to compress instead of saying   :
white white white white white white white white white white white white  .... 
the jpeg code will be something like       100000 times white      much smaller


so if the size 4000px is not a problem and you want to send in the best possible quality  - you can compress the image less in jpeg  ( in photoshop 100% is best jpeg quality)
Hope this helps,


Pieter Kers
Title: Re: I'm stuck in a very stupid situation, Please help!
Post by: aaronchan on August 31, 2017, 06:23:24 am
the white background is easy to compress instead of saying   :
white white white white white white white white white white white white  .... 
the jpeg code will be something like       100000 times white      much smaller


so if the size 4000px is not a problem than you can compress the image less in jpeg  ( in photoshop 100% is best jpeg quality
Hope this helps,


Pieter Kers

Hi,

When I save as JPG, I've set the quality to 12 already which is the highest........ :(
Title: Re: I'm stuck in a very stupid situation, Please help!
Post by: Mark D Segal on August 31, 2017, 07:57:07 am
From all of the above it seems that the only option left is to create a duplicate image file and try upsizing it by resampling to various pixel volumes within the allowed range and check for image quality. It will likely be best with the resampling (PPI) that takes the file to the bottom limit of what they accept.
Title: Re: I'm stuck in a very stupid situation, Please help!
Post by: kirkt on August 31, 2017, 08:20:19 am
A simple fix is to add a very small, practically unnoticeable amount of monochromatic noise.  For example, in PS, add a new layer above your existing image and use Filter > Noise > Add Noise...  Use something like 3-5% (or even lower) and monochromatic.  You can use a mask on this layer to add the noise only to the white area, so the image content does not get noise applied.  The amount of noise you add does not need to be that great, just enough to get the JPEG compression scheme to see that the background is not a large area of contiguous, identical blocks of color.

Save the file with JPEG quality maximum ("12" in PS, or 100%). 

As an example, I created a 5000x4000 px white document in PS (8bit, sRGB).  I saved the document with JPEG max - the file size was 128 kB.  I added 5% monochromatic gaussian noise and saved again - file size 11.4 MB.  With 2% noise, I get a file size of 8 MB.  Etc. 

You can adjust the percentage of noise and the opacity of the noise layer to tweak the file size, as well as changing the JPEG compression quality.  You can also apply a Gaussian blur to the noise layer to change (smooth) the distribution of discretely different pixels, essentially making the white area with noise more uniform - this will make JPEG compression more efficient and decrease the file size and break up any discrete noise that you may see at 100% zoom when viewing.

This should give you the flexibility to target the file size you need.

As a bonus, a small amount of noise, or "grain," sometimes improves the impression of image acutance - maybe your image will serendipitously get this little boost from adding noise too!

kirk
Title: Re: I'm stuck in a very stupid situation, Please help!
Post by: Mark D Segal on August 31, 2017, 08:36:34 am
JPEG doesn't support layers as far as I remember. What happens to the file size when you flatten it to save as JPEG?
Title: Re: I'm stuck in a very stupid situation, Please help!
Post by: kirkt on August 31, 2017, 09:21:06 am
JPEG doesn't support layers as far as I remember. What happens to the file size when you flatten it to save as JPEG?

When you save as a JPEG it flattens the image (and, if working in 16bit for editing purposes, converts to 8bit).  The numbers I was citing for file size were the JPEG files resulting from the exercise.  I assumed the OP knew this.

If you need to preserve the edibility, save a PSD with layers you can switch on and off (the various noise layers you are experimenting with) and do a "Save As..." to JPEG to output each JPEG with its specific noise layer enabled.  Using PS's "Layer Comps" feature would be helpful if you are experimenting with a bunch of different levels of noise, each on its own layer.  In PS CC you can use the "Export > Layer Comps to Files..." feature to export all of the comps to their own files, in a single batch.

Layer Comps are just saved states of, in this case, combinations of layer visibility.  So, you could enable the background and NoiseLayer01 and save that as a comp; then disable Noise Layer01 and enable NoiseLayer02 (with the background enabled) and save this as another comp, etc.  This way you have generated all of the combinations of the background and the various noise layers using comps and then you can export each comp (each combination) as a JPEG, all in a batch.  You can even repeat the process, but change the amount of JPEG compression for the batch.  Etc.  Then compare the results visually and for desired file size.

kirk

kirk
Title: Re: I'm stuck in a very stupid situation, Please help!
Post by: kers on August 31, 2017, 09:29:31 am
Well Aaron, it is indeed a stupid situation if your image has to be at least 5MB.
I would try to get it through at 3MB since this rule is only meant to certify they get the quality they need   and you already do that.
it is like with all rules- they are invented for a certain task but sometimes have an unintended life of their own.
cheers, PK


Title: Re: I'm stuck in a very stupid situation, Please help!
Post by: Daverich on August 31, 2017, 01:08:33 pm
Is there any chance that the file size requirement is the minimum size the file has to be when it's open and not the size of the .jpg? That is, they want a minimum resolution for whatever purpose they're going to use it for? As has been pointed out in previous posts, .jpg files size varies wildly depending on the content of the file so by specifying a .jpg size they would be getting images in much different resolutions. In my experience when submitting images to contests they are way more likely to specify a Maximum .jpg size that can be sent due to transmission and storage concerns. Mandating a Minimum .jpg size makes no sense. Is it possible you've misunderstood the contest requirements? And if you've talked to them about it they've misunderstood what you were asking?
Title: Re: I'm stuck in a very stupid situation, Please help!
Post by: aaronchan on August 31, 2017, 02:15:48 pm
Is there any chance that the file size requirement is the minimum size the file has to be when it's open and not the size of the .jpg? That is, they want a minimum resolution for whatever purpose they're going to use it for? As has been pointed out in previous posts, .jpg files size varies wildly depending on the content of the file so by specifying a .jpg size they would be getting images in much different resolutions. In my experience when submitting images to contests they are way more likely to specify a Maximum .jpg size that can be sent due to transmission and storage concerns. Mandating a Minimum .jpg size makes no sense. Is it possible you've misunderstood the contest requirements? And if you've talked to them about it they've misunderstood what you were asking?

Each applicant can only enter once in each cycle.Each submission must consist of a series of up to 10 images and captions, Project Statement, Biography and Personal Data. Images uploaded to the competition website must be a minimum of 5 megabytes and not exceed the maximum size of 10 megabytes, in JPEG/JPG format. If your work is voted to the shortlist of finalists, you will be asked to submit a high-resolution version of all images within 7 days of notification.



Their website has a script to detect your file size before upload


Sent from my iPhone using Tapatalk
Title: Re: I'm stuck in a very stupid situation, Please help!
Post by: Tim Lookingbill on August 31, 2017, 02:39:11 pm
Try Photoshop's "Save For Web" compression options.

It has more refined file size controls over "Save As..." jpeg and has better quality compression in rendering fine detail (I've tested this).

Also check the real file size after saving to disk by doing a "get info" or however your OS implements this. I've found the MB size is often different from the readouts in Photoshop "Save As..." and SFW.
Title: Re: I'm stuck in a very stupid situation, Please help!
Post by: Daverich on August 31, 2017, 02:50:15 pm
Each applicant can only enter once in each cycle.Each submission must consist of a series of up to 10 images and captions, Project Statement, Biography and Personal Data. Images uploaded to the competition website must be a minimum of 5 megabytes and not exceed the maximum size of 10 megabytes, in JPEG/JPG format. If your work is voted to the shortlist of finalists, you will be asked to submit a high-resolution version of all images within 7 days of notification.



Their website has a script to detect your file size before upload


Sent from my iPhone using Tapatalk

Just for the heck of it I took a random image of mine that didn't contain much in the way of solid colors and sized it so that I got a .jpg that fit within the contest requirements. An 8x12 @360 PPI of the image is 35 megs when it's open and 6.9 megs on disk as a highest quality .jpg. Basically, the image is high resolution already, I can't imagine a contest wanting something higher unless they were going to make large prints of the winners. Sizing the same image to 8x12 @150 PPI gives me an open file size of 6 megs which to me is low resolution and yet would fall within the contest specifications. Whether they were trying to stay with low resolution or high resolution files to start with, it just makes no sense to specify the size of the .jpg as a way to accomplish that because as you've already shown, the resolution of the image could be anything when it's open based on the content of the image. Just my 2 cents.
Title: Re: I'm stuck in a very stupid situation, Please help!
Post by: BradSmith on August 31, 2017, 08:48:51 pm
What if your double or triple its pixel dimensions in photoshop or in the export dialog from Lightroom?  In other words, create many more pixels.  Maybe this still won't get a final jpg bigger than 5Mb because you'll mainly be increasing all those pure white pixels.  But it is easy to do and therefore, worth a try.
Brad
Title: Re: I'm stuck in a very stupid situation, Please help!
Post by: NAwlins_Contrarian on September 01, 2017, 12:37:23 am
I was going to suggest almost exactly what kirkt suggested: add a slight amount of noise. Also, as I think he at least implied, you probably want it to be luminance noise, not color noise, which I think most people see as much more objectionable-looking. However, I was going to suggest you mask off or something and add it only to the all-white areas. That should provide a substantially greater increase in the data needed to record the image as a JPEG than would a similar noise increase in the other parts of the image--without adding noise to them.
Title: Re: I'm stuck in a very stupid situation, Please help!
Post by: joofa on September 01, 2017, 12:44:06 pm
Dear all,

I'm trying to submit a photo contest online.
Since I have to upload the image on their website, there are some rules for the image files:
File has to be between 5-10MB
File has to be in JPG

OK, so one of my pictures has a huge white background,
after converting it to JPG, it only has 2.9MB. (included sRGB icc profile)
But it's already 4000x5000 pixel.

I have contacted the CS of this contest and they said I will need to mainipulate the file size in some way........

Is there anyway to increase the file size but not effect my image itself?


Here is an experiment that I did and it worked for me. Basically, I patched a JPEG file with extra zeros at the end. I did on a Mac, but the same exact commands below can be repeated on Linux. And equivalent commands may be used on Windows.

Enter the following 2 commands in a Terminal window:

(1) Create a dummy 'zeros file':
dd if=/dev/zero bs=1 count=1048576 > zeros.bin   (Change the number 1048576 to whatever size you want. Here I created 1MB dummy file.)

(2) Patch an original JPEG and zeros file into a new bloated file:
cat original.jpg zeros.bin > bloated.jpg

It worked with Preview and Gimp. Didn't try other programs. But, I would think they would also work.

Good thing with this method is that no quality degradation needs to happen (say by adding noise or other disruptive procedures.)
Title: Re: I'm stuck in a very stupid situation, Please help!
Post by: Tim Lookingbill on September 01, 2017, 03:08:38 pm
Yes! This IS a stupid situation. All this just to enter a stupid photo contest.
Title: Re: I'm stuck in a very stupid situation, Please help!
Post by: Doug Gray on September 01, 2017, 05:42:36 pm
I was going to suggest almost exactly what kirkt suggested: add a slight amount of noise. Also, as I think he at least implied, you probably want it to be luminance noise, not color noise, which I think most people see as much more objectionable-looking. However, I was going to suggest you mask off or something and add it only to the all-white areas. That should provide a substantially greater increase in the data needed to record the image as a JPEG than would a similar noise increase in the other parts of the image--without adding noise to them.
I agree completely with both of you. It would take surprisingly little noise to reach the size requirement and, since it's added in while the image is still 16 bits, you'll often get a better jpeg
Title: Re: I'm stuck in a very stupid situation, Please help!
Post by: joofa on September 01, 2017, 05:54:07 pm
I agree completely with both of you. It would take surprisingly little noise to reach the size requirement and, since it's added in while the image is still 16 bits, you'll often get a better jpeg

I don't understand that why go through the exercise of adding noise. I already gave a solution to bloat the file size to any desired number without compromising on quality at all. It is a couple of messages above.
Title: Re: I'm stuck in a very stupid situation, Please help!
Post by: Doug Gray on September 01, 2017, 06:14:41 pm
I don't understand that why go through the exercise of adding noise. I already gave a solution to bloat the file size to any desired number without compromising on quality at all. It is a couple of messages above.

Because a small amount of noise reduces jpeg compression blocking (posterization) when going from a 16 bit tif or photoshop image files to jpeg. It may sound bad but it can really help subtle, slow gradient changes when you have to convert to jpeg and you are already at Photoshop's "max" quality of 12.
Title: Re: I'm stuck in a very stupid situation, Please help!
Post by: joofa on September 01, 2017, 06:21:33 pm
Because a small amount of noise reduces jpeg compression blocking (posterization) when going from a 16 bit tif or photoshop image files to jpeg. It may sound bad but it can really help subtle, slow gradient changes when you have to convert to jpeg and you are already at Photoshop's "max" quality of 12.

Yes, but I don't think that the OP asked a question regarding image enhancement. It was regarding file size expansion.

How much noise do you need to add to go from OP's 2.9M to 5M-10M requirement? Are you sure it will still be unnoticeable?  That is like over 2x - 3x the original JPEG file size.
Title: Re: I'm stuck in a very stupid situation, Please help!
Post by: Doug Gray on September 01, 2017, 06:41:04 pm
Yes, but I don't think that the OP asked a question regarding image enhancement. It was regarding file size expansion.

How much noise do you need to add to go from OP's 2.9M to 5M-10M requirement? Are you sure it will still be unnoticeable?  That is like over 2x - 3x the original JPEG file size.

Depends on the image but typically it takes very little noise to double the file size. It's also not an image enhancement as much as it is a restoration of the smoother appearing gradients in the original at the cost of a larger file size. Jpeg compression, which is lossy, can be pretty brutal because of its design goal of small size back when that really mattered decades ago.
Title: Re: I'm stuck in a very stupid situation, Please help!
Post by: Tim Lookingbill on September 01, 2017, 08:20:16 pm
I don't understand that why go through the exercise of adding noise. I already gave a solution to bloat the file size to any desired number without compromising on quality at all. It is a couple of messages above.

Don't you think this is beginning to be a joke thread? I mean really! Coding?! Just to make the image fit some minimal size requirement? You know I read your comment.

Hopefully someone will post a link to this thread in an email to the contest officials making this silly, stupid rule and we can all have a laugh afterwards. Ha! Ha! Ha! It is to laugh!
Title: Re: I'm stuck in a very stupid situation, Please help!
Post by: Daverich on September 04, 2017, 07:29:01 am
Each applicant can only enter once in each cycle.Each submission must consist of a series of up to 10 images and captions, Project Statement, Biography and Personal Data. Images uploaded to the competition website must be a minimum of 5 megabytes and not exceed the maximum size of 10 megabytes, in JPEG/JPG format. If your work is voted to the shortlist of finalists, you will be asked to submit a high-resolution version of all images within 7 days of notification.



Their website has a script to detect your file size before upload


Sent from my iPhone using Tapatalk

I Googled the submission requirements exactly as you wrote them and this is the one contest that came up. If this is the right one they responded to my request of info that it is File Size, not .jpg size they are referring to.

Title: Re: I'm stuck in a very stupid situation, Please help!
Post by: aaronchan on September 04, 2017, 10:51:16 am
I Googled the submission requirements exactly as you wrote them and this is the one contest that came up. If this is the right one they responded to my request of info that it is File Size, not .jpg size they are referring to.

Trust me
I have went through everything
And I'm pretty sure the who answered your question doesn't know the difference between actual file size vs jpg size.

Anyway, I just submitted my work by resizing them in a super big size, 10k pixel by 80k pixel.

But I am sure I will write them a technical article about what just happened to me.

Thanks
Aaron


Sent from my iPhone using Tapatalk
Title: Re: I'm stuck in a very stupid situation, Please help!
Post by: Daverich on September 04, 2017, 11:44:58 am
Trust me
I have went through everything
And I'm pretty sure the who answered your question doesn't know the difference between actual file size vs jpg size.

Anyway, I just submitted my work by resizing them in a super big size, 10k pixel by 80k pixel.

But I am sure I will write them a technical article about what just happened to me.

Thanks
Aaron


Sent from my iPhone using Tapatalk

In my earlier post I ended up with a .jpg that met what you claimed were their requirements of a 5 to 10 megabyte .jpg with a image that was 35 Megabytes in size. You just sent them a 2 1/4 GIGAbyte image. Why bother having a size requirement at all if that's acceptable? Looking at their web site and the quality of the images that have been submitted in the past as well as the judges and other people involved in the contest I can't imagine that the person answering technical questions via their contact form doesn't understand something as basic as the one I asked. But it's no skin off my nose, I'm not planning on submitting an image. You have your answer, choose to accept it or not, it's up to you.
Title: Re: I'm stuck in a very stupid situation, Please help!
Post by: DaveOffutt on September 06, 2017, 01:41:44 pm
Have you tried increasing the Image Resolution?  I was able to increase a 40kb JPG to 9MB by simply increasing the resolution from 72 to 1000 pixels/inch while keeping the image dimensions the same.

Your 2.9MB JPG would need its resolution increased by a factor of about 2x to get it in the 5-10MB range.

Increasing the resolution has no real impact on a JPG other than making it more difficult to edit later.