473,396 Members | 1,987 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.

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

Hello,

I am a .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.

Apr 30 '06 #1
6 3476
"NutsAboutVB" <de*@sms-networks.com> wrote:
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 don't know the answer, sorry. But I've been to several research
talks in the past few months where the vision researches come up with
automatic ways to detect image similarity. It's important for several
consumer-level products -- e.g. automatic image stitching (where you
have to figure out where the edge of one photo is the same as the
opposite edge of another photo), and internet image search, and
producing maps of cities.

It sounds a lot like you should give up on trying to explore
pixel-level differences, and should instead use a more general
solution from this kind of research field.

--
Lucian
Apr 30 '06 #2
Hello,

I appreciate your response and would be happy to look into any relevant
web addresses that you may be able to provide in relation to the
research that you were talking about.

I'm really just trying to figure otu what each application does to the
image pixel wise (i have no care for the meta data or headers, they are
of no relevance to me). if i knew the 'types' of changes that occur,
then i would quite easily write aggressive loops to figure out the
level of alterations that are imposed onto the image (values passed to
encoder parameters etc).

That would be perfect!

Apr 30 '06 #3
This is how jpeg works - you can not even get the same rgb values even when
compressing the original image and then compressing the compressed again.
What you should do when you care about exact rgb values is either to look at
some compression method which has such feature (I guess gif would do, maybe
png too) or don't compress the images by aby image compression method at all
and use tiff or bmp images and compress them with come lossless data
compression method (e.g. zip) which will give you about the same compression
ratio as highest quality jpeg. There is also a built-in implementation of
some lossless compression methods (e.g. RLE, LZW) in some tiff/bmp formats.

Hope I have provided at least some pointers.
"NutsAboutVB" <de*@sms-networks.com> wrote in message
news:11**********************@e56g2000cwe.googlegr oups.com...
Hello,

I am a .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.

May 1 '06 #4
I've read your post again and I think I originally misunderstood your
question.
If I understand correctly, you are not having control over how the images
are compressed and want to process/find differences/ images you possibly get
from the user, who compressed the image with his own software.
As Lucian has suggested, it would be better to look for other solution in
this case, because it would be extra time consuming to try all possible
combinations of compression parameters to find out what the user has used,
and I doubt it would be possible in real time (if you had just 100 levels of
quality and 100 levels of luminance and 100 levels of chrominance you would
have to compress and compare the image 1000000 times, which is not
feasible - and I'm afraid there are even more combinations)

"NutsAboutVB" <de*@sms-networks.com> wrote in message
news:11**********************@e56g2000cwe.googlegr oups.com...
Hello,

I am a .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.

May 1 '06 #5
Lebesgue,

Yes, thats exactly it, I have no control over what others are using, so
i at least need to estimate most common possible types of combinations,
or use completely other form of logic to achieve what i achieve. But,
if you know the types of changes that are performed, perhaps a summary
would be great so that i could resume further pending investigation in
this area. The positive point is that i can take a few hours of time to
process these combination (doesn't need to be real time).

Do you think luminance and chrominance changes are made (without users
request) when they open & save a file? I know that quality (via
compression) alterations are made, but thats about it. Not sure what
other changes occur, nor of their definitions.

I can look up the definitions if i knew the names of the types of
changes which do take place, so if anyone who knows can provide a
simple list that would be very helpful.

In addition, i would also behappy to look into similarity comparison
research and available software/components if they exists, and if
anyone knows, some links or names to look under would be very helpful
:).

Thank you.

May 1 '06 #6
"NutsAboutVB" <de*@sms-networks.com> wrote:
I appreciate your response and would be happy to look into any relevant
web addresses that you may be able to provide in relation to the
research that you were talking about.


Sorry, I don't have any precise links. In my mind I was thinking of
this page

http://research.microsoft.com/vision/cambridge/

but all of these are actually trying to solve MUCH harder
generalizations of your problem! Still, reading their publications
might be a good start.

--
Lucian
May 1 '06 #7

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

Similar topics

5
by: news.west.cox.net | last post by:
I have a fairly simple Python program that uses Image and ImageDraw to create poll results on the fly. Because PIL only supports 256 colors for GIF and BMPs are huge (in comparison)... I have...
4
by: Dom Hicklin | last post by:
I have created a form onto which images can be dropped and thus added to the OLE field of a Table (Access 2000 linked to SQL 2000 server). I use the Stephen Lebans ExportOLE function to do this...
2
by: darrel | last post by:
I have written an image upload/resize tool that then saves out the image as either a JPG or GIF. I got the JPG save working nicely, using a codec and setting the compression to 90%. However,...
2
by: Kim Bach Petersen | last post by:
Using asp.net, I'm generating bitmaps, that I stream either as gif- og jpg-images (se code below). In both cases, the image-quality is rather poor: ...
1
by: NutsAboutVB | last post by:
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...
7
by: pamela fluente | last post by:
I have been using something like: public void SaveJPG(Image Image, string FileName, long QualityLevel_0_100, long ColorDepthLevel) { ImageCodecInfo ImageCodecInfoJPG =...
3
by: salmobytes | last post by:
Every img tag (<img src="xxx.jpg">) in the html source represents a separate GET roundtrip between client and server, no? What about background images in css? I'm starting to see more and more...
2
by: almurph | last post by:
Hi, Hope you can help me wit this one. I have to open either a ".jpg", ".bmp" or a "gif" and alter its dimensions and save the output as a .gif. Here is my attempt - I would greatly...
0
by: ruthruth | last post by:
Wished to know in detail abt the below 1-what are the various compression strategies designed specifically for XML data.? 2- comparison between AXECHOP AND TREECHOP techniques to other XML...
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: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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.