473,795 Members | 2,512 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

save as progressive JPEG

25 New Member
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 6008
tlhintoq
3,525 Recognized Expert Specialist
"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
byteit101
25 New Member
@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 Recognized Expert Expert
Progressive IS line by line.
Interlaced is every other line

No idea how the blurry->sharp comes about
Sep 15 '09 #4
byteit101
25 New Member
@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 Recognized Expert Expert
Ah, I was thinking of the old GIF style of terminology:
"Interlacin g is also known as "progressiv e" 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 "Progressiv e 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
3683
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: 55,56,57,58,59,60,134,135,136,137
9
2645
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 with a Bitmap the results are Black. Can you somehow Clip the Grafic and Paste it into the Bitmap ? Mark Johnson, Berlin Germany mj10777@mj10777.de
2
2643
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 current directory. here's the code for the save box: SaveFileDialog sfd = new SaveFileDialog(); sfd.Filter = "Portable Document Format (*.pdf)|*.pdf" + "|Encapsulated Postscript (*.eps)|*.eps" + "|Bitmap (*.bmp)|*.bmp" + "|JPEG...
12
57335
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 "System.NullReferenceException: Object reference not set to an instance of an object." Can anyone help? Thanks... --
2
3863
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 Details: System.Runtime.InteropServices.ExternalException: A generic error occurred in GDI+.
2
4104
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 = File.Open(sSrcFile,FileMode.Open,FileAccess.Read,FileShare.None); Bitmap imgPhoto=new Bitmap(BitmapStream); iPixelsX=imgPhoto.Width; iPixelsY=imgPhoto.Height; BitmapStream.Close();
0
1414
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 JPEG files. I'm trying to find information about how to identify a progressive and non-progressive JPGE image, but I'm stuck. Does anyone knows if I can find the progressive information just analysing the JPEG header or that is part of the...
1
3606
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 buffer easily into JPEG file. But now i need to save the buffer into JPEG 2000(jp2) format file. And also if anyone know how to use CXImage free Library or Jasper Library
0
1347
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 Random((int)DateTime.Now.Ticks); // seeded with ticks myPen = new Pen(Color.Red);
0
9672
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9519
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10438
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10001
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9042
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5437
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5563
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3727
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2920
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.