473,396 Members | 2,109 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.

save as progressive JPEG

I am working a an Image processing program, and I want to save my jpegs as being progressive (blurry to sharp instead of line by line while it loads). this does not work howerver:
Expand|Select|Wrap|Line Numbers
  1. ImageCodecInfo iciJpegCodec = null;
  2. EncoderParameter epQuality = new EncoderParameter(System.Drawing.Imaging.Encoder.Quality, 98L);
  3. ImageCodecInfo[] iciCodecs = ImageCodecInfo.GetImageEncoders();
  4. EncoderParameters epParameters = new EncoderParameters(2);
  5. epParameters.Param[0] = epQuality;
  6. epParameters.Param[1] = new EncoderParameter(System.Drawing.Imaging.Encoder.RenderMethod, EncoderValue.RenderProgressive);//does not work
  7. for (int i = 0; i < iciCodecs.Length; i++)
  8. {
  9.     if (iciCodecs[i].MimeType == "image/jpeg")
  10.     {
  11.         iciJpegCodec = iciCodecs[i];
  12.         break;
  13.     }
  14. }
  15.  
  16. btmp.Save(toplace, iciJpegCodec, epParameters);
Sep 13 '09 #1
5 5932
tlhintoq
3,525 Expert 2GB
"Does not a work" is more than just a little vague. Do you get an error message? Does the code break on a given line? Do you get no errors but it doesn't save?
Sep 14 '09 #2
@tlhintoq
It saves with no errors, but it is not progressive. (when I use Firefox throttle, it comes in line by line)
Sep 14 '09 #3
Plater
7,872 Expert 4TB
Progressive IS line by line.
Interlaced is every other line

No idea how the blurry->sharp comes about
Sep 15 '09 #4
@Plater
line by line is standard JPEG
blurry->sharp is progressive

http://ask-leo.com/blurry_images_why..._clear_up.html
Sep 15 '09 #5
Plater
7,872 Expert 4TB
Ah, I was thinking of the old GIF style of terminology:
"Interlacing is also known as "progressive" encoding, because the image becomes progressively clearer as it is received. This terminology is different than the interlaced and progressive scan terminology of video encoding."

According to what I read in the wiki, you would want the interlace.
Interlacing is a method of encoding a bitmap image such that a person who has partially received it sees a degraded copy of the entire image. When communicating over a slow communications link, this is often preferable to seeing a perfectly clear copy of one part of the image, as it helps the viewer decide more quickly whether to abort or continue the transmission.
Or
There is also an interlaced "Progressive JPEG" format, in which data is compressed in multiple passes of progressively higher detail. This is ideal for large images that will be displayed while downloading over a slow connection, allowing a reasonable preview after receiving only a portion of the data. However, progressive JPEGs are not as widely supported, and even some software which does support them (such as some versions of Internet Explorer) only displays the image once it has been completely downloaded.
Sep 15 '09 #6

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Carlo | last post by:
I have a table with a lot of fields. One is a numeric field. How can I introduce in these field a progressive number. I have to change at times the start number. example:...
9
by: Mark Johnson | last post by:
How can you save all or a portion of the Grafics object to a Image/Bitmap ? I am try to save the Images from Cards.dll to a BitMap file. I can read in the Images to the Grafics, but when I try this...
2
by: Pat Richey | last post by:
i'm trying to make an open and a save file dialog that allows you to open/save various formats, but when you change the extension you want to filter the file list disappears until you leave the...
12
by: yaya via DotNetMonster.com | last post by:
Hi, I have a picture box with circles and rectangles, and I wana save all the images into a jpg file, i tried pictureBox1.Image.Save(@"c:\1.jpg"); but I got and error...
2
by: Barry | last post by:
Hi Does anyone know why i am getting the following error message (line 64) , if i change to objBitmap.Save(Response.OutputStream, ImageFormat.Jpeg) i do not get this error Exception...
2
by: Olaf Baeyens | last post by:
I want to convert one bitmap file to another one. For example load as bmp and save as jpg. The loading part is simple I do this: Stream BitmapStream =...
0
by: nhacnhac | last post by:
Hi Guys does anyone knows if the a JPEG file saved as JFIF version 1.02 is always considered progressive? I need to create a program in C# to open JPEG files and upload just the non-progressive...
1
by: keyesarone | last post by:
Hi, I am using VC++ 6.0 with directshow 9.0 to capture video from the camera. Using GDI+ Bitmap class and i am saving the buffer image into JPEG format file. When i use GDI+, i can save the...
0
by: phanibiddu | last post by:
How to draw on windows form and save it as Jpeg file I am trying with this code but not comming public Form3() { InitializeComponent(); //rnd = new...
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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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
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
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
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.