PC Review


Reply
Thread Tools Rate Thread

Desperately needing direction with EncoderParameters and saving images under different compression/quality schemes

 
 
NutsAboutVB
Guest
Posts: n/a
 
      30th Apr 2006
Hello,

I am a VB.NET programmer and I have a JPEG image file (from digital
camera) of about 109 KB's in size, when I open it and save it
(without making any alterations at all, just going to File --> Save) in
MS Photo Editor, the file is automatically shrunk in size to 81 KB's.
When doing the same thing in MS Paint, the file is shrunk to 54 KB's.
The file has the same number of pixels after both saves (as expected).
My question follows...

What are the 'automatic' changes that typical image editing
software products perform to our images APART from any changes or
alterations that we may make ourselves?

I understand that one of these would be some form of compression (say,
at 90) but I am unfamiliar with the other types of alterations that are
made. When I compare the pixels in the original file and the new saved
file (even without making changes, just opening & saving the file) I
get completely different RGB values in each pixel. This is really bad,
since (in my application) I need to be able to predict all typical (non
explicit) changes made by graphics programs to normal images. So I have
tried compressing the images via .NET code (EncoderParameters etc) at
all possible values, 100, 99, 98 etc all the way down to 0 and I can
not reproduce the exact pixel arrangements imposed by MS Photo Editor.

My question is, why can't I, and what other types of transformations
do I need to look into in order to try to replicate (and predict) such
different pixel RGB values/arrangements imposed by various graphics
programs? I don't know much about JPEG so not sure what
ChrominanceTables and Luminance values are. The only thing I've tried
altering is the Encoder.Quality parameter, and this accepts only
parameter values between 0 and 100 of Long (Int64) data type. So in
addition, can't I specify 89.5 or 94.3 (non integer) type values? Is
this not in the JPEG spec to accept decimal values or is the .NET
framework just limited in this way? Because I'm wondering, maybe
these other software applications are specifying decimal fractions for
the Quality setting of the encoder.

So, in summary, just need to know...
1). What types of 'automatic changes' typically occur when an image
is opened & saved using typical graphics programs?
2). If it is possible to pass non integer values floating point values
(Single/Double/Decimal etc) for the Quality setting in the
EncoderParameter object?

I've had too many headaches because of this, Microsoft documentation
is really bad, I understand my purposes may sound uncommon but I really
need to be able to understand the types of automatic changes that are
occurring, thank you in advance. I will respond promptly to all input,
anything would be appreciated at this stage since I'm really empty
direction wise.

Thank you.

 
Reply With Quote
 
 
 
 
Carl Daniel [VC++ MVP]
Guest
Posts: n/a
 
      1st May 2006
"NutsAboutVB" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Hello,
>
> I am a VB.NET programmer and I have a JPEG image file (from digital
> camera) of about 109 KB's in size, when I open it and save it
> (without making any alterations at all, just going to File --> Save) in
> MS Photo Editor, the file is automatically shrunk in size to 81 KB's.
> When doing the same thing in MS Paint, the file is shrunk to 54 KB's.
> The file has the same number of pixels after both saves (as expected).
> My question follows...
>
> (details snipped)
>
> So, in summary, just need to know...
> 1). What types of 'automatic changes' typically occur when an image
> is opened & saved using typical graphics programs?
> 2). If it is possible to pass non integer values floating point values
> (Single/Double/Decimal etc) for the Quality setting in the
> EncoderParameter object?


Let me cut right to the chase - you cannot (re)save a JPEG file without
changing (nearly) every pixel except under very special circumstances.

In the JPEG specification, there's no such thing as a "quality level"
mentioned anywhere. The JPEG encoding process is defined in terms of
quantization tables and other arcana that fit into the low-level details of
the encoding algorithms. The "quality level" knob on some piece of image
processing software is fed into some algorithmic model that's used to
generate quantization tables (etc), but the exact process used is, in
general, unique to the application and likely won't be duplicated in another
application.

In the end, I'm not really sure what exactly you're trying to do, but it
sounds like you're trying to push a rope uphill. If you need 100%
predictable image content, you need to do something different.

-cd



 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Desperately needing direction with EncoderParameters and saving images under different compression/quality schemes NutsAboutVB Microsoft C# .NET 6 1st May 2006 05:08 PM
Desperately needing direction with EncoderParameters and saving images under different compression/quality schemes NutsAboutVB Microsoft VB .NET 1 1st May 2006 05:29 AM
Desperately Needing Help =?Utf-8?B?TW9sZWN1bG9y?= Windows XP Help 2 1st Dec 2004 11:26 PM
Desperately Needing Help =?Utf-8?B?TW9sZWN1bG9y?= Windows XP General 0 1st Dec 2004 11:13 PM
Desperately Needing Help =?Utf-8?B?TW9sZWN1bG9y?= Windows XP General 0 1st Dec 2004 11:13 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 11:44 AM.