Ugly Hedgehog - Photography Forum
Home Active Topics Newest Pictures Search Login Register
Main Photography Discussion
Setting Some Things About JPG Format Straight
Page <<first <prev 6 of 8 next> last>>
Feb 20, 2018 14:48:40   #
rmalarz Loc: Tempe, Arizona
 
Todd, I have and have read that book a couple of times, along with using it for reference I don't know how many additional times.

From what I gained in that book, I used to use a hex editor to make changes to jpg files, just to see what would happen.

As I mentioned, it's easy to prove to oneself. Just find and download the free program windiff. If you're using a UNIX based system the diff function works similarly. It's not that difficult to prove it to oneself.
--Bob
Notorious T.O.D. wrote:
There is a book I had probably 20 or more years ago called Graphic File Formats, IIRC. It covered all sorts of information about both lossless and lossy file formats. I do not recall the author off hand. It was sort of the Bible of graphic file formats.

Best,
Todd Ferguson

Reply
Feb 20, 2018 14:50:16   #
TheDman Loc: USA
 
Kuzano wrote:
Since I rely on my images for income, I never shoot RAW!

SOOC, from a custom profile or a properly adjusted camera is where the money is!

JPEG only, with minimal PP!


(Download)

Reply
Feb 20, 2018 15:19:44   #
rehess Loc: South Bend, Indiana, USA
 
Part of what confuses people is understanding what "open" means. When a program, an editor or a viewer, "opens" a file, it makes its own copy of the contents - normally it doesn't affect what is on the disc other than possibly asking the operating system to make a note that the file is in use. Thus, if the program just "closes" the file, everything is exactly as it was before the "open" .... there is no reason to "save" the file unless you have made changes. This us exactly the same as "opening" a book many times and {apart from possible wear to the page edges} not affect the book.

Reply
 
 
Feb 20, 2018 15:24:43   #
rmalarz Loc: Tempe, Arizona
 
Very good additional information. Too many folks are adding to the confusion with convoluted file changes, save as, etc. The initial premise is that simply saving the file after opening, looking, and doing nothing to it will change the original file. Your additional clarification, I hope, helps just that much more. Thanks.
--Bob

rehess wrote:
Part of what confuses people is understanding what "open" means. When a program, an editor or a viewer, "opens" a file, it makes its own copy of the contents - normally it doesn't affect what is on the disc other than possibly asking the operating system to make a note that the file is in use. Thus, if the program just "closes" the file, everything is exactly as it was before the "open" .... there is no reason to "save" the file unless you have made changes. This us exactly the same as "opening" a book many times and {apart from possible wear to the page edges} not affect the book.
Part of what confuses people is understanding what... (show quote)

Reply
Feb 20, 2018 15:37:20   #
Vince68 Loc: Wappingers Falls, NY
 
rmalarz wrote:
This is not going to be a "this format is better than...". It's simply going to clear up a few misconceptions bandied about on this forum regarding the jpg file format. In fact, it's only going to clear up one misconception about this file format. The jpg format is a lossy file format. This means it is going to lose data. An understanding of discrete cosine transforms would be helpful in understanding the process. However, suffice it to say, here's what this post is going to clear up.

If one opens a jpg file, looks at it, and closes it, nothing happens to the file.

If one opens a jpg file, looks at it, and saves it, it degrades.

This is just the nature of the jpg file format and the save algorithm. It's that simple. Open, Look, Close, nothing. Open, Look, Save, file changes.

Yes, one can edit a jpg. However, in addition to the edits one makes, the save process works just the same making additional changes to the file over which the photographer has no control. The only control the photographer has is how much more gets changed based on the amount of compression selected at the time of saving the file.

If you don't believe this, it's simple to prove. Using the diff function in UNIX, or the free Windows program windiff will show you the changes. Can you visually see them, perhaps yes, perhaps no. The changes are there none the less. Again, it requires nothing more than a Save to instigate a change to the file.
--Bob
This is not going to be a "this format is bet... (show quote)


Good post Bob. Whether it clears up the misconceptions about .jpg or not is another thing. This topic seems to come up constantly. Here is a link I posted to someones question a week or so ago from petapixel. https://petapixel.com/2010/02/04/saving-jpeg-photos-hundreds-of-times/

As you said, opening, viewing, and closing will not degrade the jpg photo. But when opening a jpg and "Saving it", that will degrade the image over time because each time it is saved it is compressed, which results in detail and data being lost.

Would anyone open and save an image as many times as in the video link? Most likely not, but it just illustrates the damage that is being done each and every time the file is opened and saved, even if no editing was performed.

Reply
Feb 20, 2018 16:11:36   #
Mr palmer Loc: Currently: Colorado, USA, Terra, Sol
 
Ok mods. You can close this thread. The topic has been completely destroyed. The village is good now.

Reply
Feb 20, 2018 16:31:29   #
drklrd Loc: Cincinnati Ohio
 
tri X was Black and white....

Reply
 
 
Feb 20, 2018 16:31:52   #
tenny52 Loc: San Francisco
 
Bill_de wrote:
What programs that you use offer the 'save' option if you just open it? Usually they offer the 'save as' command, and if you don't at least change the name it tells you the file already exists.

--

I regularly use Faststone to view my pictures.
If I keep on viewing picture after picture, no change.
If I use the File-save as, then the ending file increases about 10Kb for my 3-5Mb jpgs.
Should there be any degrading, I can't tell.

Reply
Feb 20, 2018 16:43:44   #
rdrechsler Loc: Channel Islands Harbor, CA
 
Very interesting information. As I'm just getting back into photography with two new cameras (Canon SX60HS and Nikon D3200) I'm already seeing the advantages of Raw over JPEG. Now I understand a little better. Thanks for posting, Dick

Reply
Feb 20, 2018 17:09:28   #
Notorious T.O.D. Loc: Harrisburg, North Carolina
 
Ah, but is the modification reversible... That is the issue...too....

DaveC1 wrote:
I tend to to this with all image files. So my original file is say img0001.tif (or .jpg or whatever) my modification is saved as img0001r1.1.tif if I move to a different type of modification the saved file is img0001r2.1.tif so there is a trail of my work.

Reply
Feb 20, 2018 17:26:17   #
Notorious T.O.D. Loc: Harrisburg, North Carolina
 
Bob,

I wrote CAD software for GM for about 6 years after I got out of college. I worked in the days of limited memory and even limited precision to some extent in calculations. Memory registers were so limited that I remember writing programs that what data resided in a specific register could be 5 or 6 different specific pieces of data depending upon where you were in the program code. Then there was the inter program communication where you might have 50 different programs talking with each other too. The files could get large and the instability in the hardware or operator error could lead to crashes and corrupted data files. While it was not generally my role we had several people who were very talented at reading octal dumps of the CAD data files and finding the corruption and often being able to link around the corruption and restore most of the work. Most of the data was simply linked elements that had a unique data definition. Line, arc, text, etc. and each element include a pointer to the previous element and the following element. A linked list of elements more or less to simplify. I moved on to solids modeling and 3D printing in the late 80s. Eventually after playing with AI for a while and working on the EV1 Electric car I migrated toward imaging and document management. That is where I really got into different graphic file formats and encountered the book. There are many interesting problems to solve especially in taking old paper documents and converting them to digital documents and trying to get everything to live with computer created documents in peace and harmony. Of course there is the whole base of mathematics to define and manipulate 3D objects in space and how they interact with one another. I tried to steer clear of the complex math as much as I could but you always knew it was lurking there just under the surface.

Best,
Todd

rmalarz wrote:
Todd, I have and have read that book a couple of times, along with using it for reference I don't know how many additional times.

From what I gained in that book, I used to use a hex editor to make changes to jpg files, just to see what would happen.

As I mentioned, it's easy to prove to oneself. Just find and download the free program windiff. If you're using a UNIX based system the diff function works similarly. It's not that difficult to prove it to oneself.
--Bob

Reply
 
 
Feb 20, 2018 19:19:25   #
DaveC1 Loc: South East US
 
Notorious T.O.D. wrote:
Ah, but is the modification reversible... That is the issue...too....


Well that's the point. In the end of my little example I have three files. I have the original img0001.tif; I have img0001r1.1.tif and I have img0001r2.1.tif

So I have the original file, the first modification file, and I have the second modification file. There is no need to reverse anything I have left myself a trail detailing my work.

I'm sorry if I did not make myself clear.

Reply
Feb 20, 2018 20:00:19   #
burkphoto Loc: High Point, NC
 
bsprague wrote:
"It's that simple. Open, Look, Close, nothing. Open, Look, Save, file changes."

No argument with that at all. It is the technical, factual reality.

But artistically or creatively the picture gets less clear. I have stunning (to me!) JPEGs from small sensor cameras and stunning (to me!) RAWs, TIFFs and PSDs.


As do I, Bill!

I also have years of experience in a high volume pro portrait lab where we used an all-JPEG workflow to print millions of images. Images were:

1: saved as Large, Fine JPEGs at the cameras.

2: opened, converted to 12-bits, color adjusted, and saved as 8-bits (same size and low compression).

3: opened and retouched in Photoshop or KPARS (Kodak’s Professional Automatic Retouching Software), then saved at the same size, with less compression.

4: opened and rendered to portrait package “multiple” sheets, and saved as JPEGs into job queues for Noritsu mini-labs.

In blind tests, we could NOT see JPEG deterioration or artifacts in 8x10 test prints made at each stage.

Much angst is shed over JPEG compression artifacts, mosquito noise, jaggies, etc. but I haven’t seen issues with that in any lab workflow. A photo lab is not an Internet ad agency or a shady porn site.

YES, you WILL see that stuff if you compress small size (800x640 pixel dimensions) images at 40:1 for use on a web page, and then stupidly compress those same images more than once.

If you have 2000x3000 or more pixels, saved at maximum quality settings in camera, JPEGs withstand two or three more gentle (10:1 or less) compression saves, and still look good in prints viewed at 1 to 1.5 times their diagonal dimensions.

Reply
Feb 20, 2018 20:15:24   #
selmslie Loc: Fernandina Beach, FL, USA
 
rmalarz wrote:
... If one opens a jpg file, looks at it, and saves it, it degrades. ...

It's easy to prove to yourself that this is not the case. All you need to do is open a JPEG, save it with 100% quality and then do a series of SaveAs steps, renaming the file each time.

I did that with the attached image and each one of them ended up with exactly the same number of bytes. If there had been any degradation, the total number of bytes might have changed. I compared the actual bytes of these two files and they were all identical throughout, even after four saves.

I only tested this with 100% JPEG quality.

SaveAs #1, 634,304 bytes
SaveAs #1, 634,304 bytes...
(Download)

SaveAs #4, 634,304 bytes
SaveAs #4, 634,304 bytes...
(Download)

Reply
Feb 20, 2018 21:54:18   #
selmslie Loc: Fernandina Beach, FL, USA
 
selmslie wrote:
... I did that with the attached image and each one of them ended up with exactly the same number of bytes. If there had been any degradation, the total number of bytes might have changed. ....

To be fair, I repeated the test by:

1. opening the first image, saving it to image 2, closing it
2. opening image 2, saving it to image 3, closing it
3. opening image 3, saving it to image 4

The result was interesting.

The total bytes grew from 620k to 695k to 721k and finally 743k. The difference in file size was all in the file header but the actual image portion of the file did not change.

So there was no actual or visible image degradation. Only a drop in efficiency in the compression process as more information was added to the file header.

Reply
Page <<first <prev 6 of 8 next> last>>
If you want to reply, then register here. Registration is free and your account is created instantly, so you can post right away.
Main Photography Discussion
UglyHedgehog.com - Forum
Copyright 2011-2024 Ugly Hedgehog, Inc.