473,396 Members | 1,743 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

modifying image metadata causes quality degradation?

Hi everyone,

I'm using the System.Drawing.Imaging.Bitmap to retrieve and modify the
metadata tags (user comments, keywords etc) of JPEGS. I was wondering if
changing these tags in any way degrades the image quality of the JPEG. I am
using SetPropertyItem to change the tag value and then calling the Save
method to save the JPEG under a different name (you have to do this because
GDI holds a lock on the original file)....

If there is an image degradation problem, I will have to port the metadata
to a database, which I would like to avoid at all costs.

Thanks for any info on this folks.
Nov 16 '05 #1
2 2896
Hello,
The problem is not because of the metadata but because JPEG compression is
lossy and unless you save at 100% fidelity you will always degrade the
image.

If the image quality is set to 90% on the first save the cumulative effects
of lossy compression will make the image quality drop from 100% to 90% then
81% and 73% and so-on.

Unfortunately, saving JPEG with 100% creates large files.

--
Bob Powell [MVP]
Visual C#, System.Drawing

The Image Transition Library wraps up and LED style instrumentation is
available in the June of Well Formed for C# or VB programmers
http://www.bobpowell.net/currentissue.htm

Answer those GDI+ questions with the GDI+ FAQ
http://www.bobpowell.net/gdiplus_faq.htm

The GDI+ FAQ RSS feed: http://www.bobpowell.net/faqfeed.xml
Windows Forms Tips and Tricks RSS: http://www.bobpowell.net/tipstricks.xml
Bob's Blog: http://bobpowelldotnet.blogspot.com/atom.xml


"Travis" <n@n.i> wrote in message news:40**********@newspeer2.tds.net...
Hi everyone,

I'm using the System.Drawing.Imaging.Bitmap to retrieve and modify the
metadata tags (user comments, keywords etc) of JPEGS. I was wondering if
changing these tags in any way degrades the image quality of the JPEG. I am using SetPropertyItem to change the tag value and then calling the Save
method to save the JPEG under a different name (you have to do this because GDI holds a lock on the original file)....

If there is an image degradation problem, I will have to port the metadata
to a database, which I would like to avoid at all costs.

Thanks for any info on this folks.

Nov 16 '05 #2
On Wed, 30 Jun 2004 21:48:48 +0200, "Bob Powell [MVP]"
<bob@_spamkiller_bobpowell.net> wrote:
Hello,
The problem is not because of the metadata but because JPEG compression is
lossy and unless you save at 100% fidelity you will always degrade the
image.

If the image quality is set to 90% on the first save the cumulative effects
of lossy compression will make the image quality drop from 100% to 90% then
81% and 73% and so-on.

Unfortunately, saving JPEG with 100% creates large files.


That's a little misleading; loss when saving at the same quality
repeatedly is not equal. If the data hasn't changed, the forward DCT
will generally produce nearly the same values as were saved
previously.

The lower the quality setting, the more the generational loss; but at
Q90, you won't see 10% loss of quality every time you save.

Decent imaging libraries include the ability to modify metadata
without recompressing JPEG files. If the C# library doesn't do this,
it is quite simply broken.

--
Sev
Nov 16 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Greg Christie | last post by:
I think I have a somewhat unique situation here, so I thought I should post it for the few poor souls who run across it and try to google it like I did. First of all, I was getting the following...
5
by: jrmsmo | last post by:
Hi I have a document as follows: <?xml version="1.0"?> <metadata xml:lang="en"> </metadata> I want to change the document so it looks as follows: <?xml version="1.0"?> <metadata...
13
by: Neo Geshel | last post by:
I have examined about 80+ different upload scripts on the 'net, both in VB and C#, and none seem to do what I need them to do. Perhaps someone here can point me somewhere that Google hasn't...
7
by: lgbjr | last post by:
Hello All, I¡¯m using a context menu associated with some pictureboxes to provide copy/paste functionality. Copying the image to the clipboard was easy. But pasting an image from the clipboard...
5
by: Socrates | last post by:
I am interested in developing an online utility that will enable users to copy and past any image (or upload any image on the internet) to the online utility, which will then convert the image to...
4
by: Greg | last post by:
I've searched everywhere for a solution Microsoft .NET Framework V 2.0.50727 AutoEventWireup="false" image2.aspx resize an image on the fly but Page_Load is triggered twice: Any suggestion?...
3
by: femtox77 | last post by:
Hi to all!!! I'm trying to convert a pdf file into an image, for example JPG or PNG format, with ImageMagick. I use the command line. For example: convert header.pdf header.jpg. But I obtain a...
9
by: kombu67 | last post by:
I'm reading a series of images from a MS SQL table and saving them to directory. These are staff ID pictures from our security card app. Once I've extracted the ID photo from the security app to...
8
by: JJ | last post by:
Whilst I am resizing images I am losing quality. This is only happening in small amounts, but if you repeatedly put the same image through the following code, the image quality slowly degrades. Can...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.