dynamically generated image's quality

Discussion in 'ASP .Net' started by Ersin Gençtürk, Apr 29, 2005.

  1. Hi ,

    I am creating dynamic images (for example writing text into a bitmap) and
    saving it to the output stream with gdi library in .net but I can't adjust
    image quality.

    The best parameters with everything is set to fine also gives me low quality
    ? how can I set the quality to the maximum ? What is wrong here ?



    Bitmap pic = new Bitmap(width, height, PixelFormat.Format24bppRgb);

    //some stuff here drawing picture

    //saving the picture

    ImageCodecInfo[] icf = ImageCodecInfo.GetImageEncoders();

    EncoderParameters encps = new EncoderParameters( 1 );

    EncoderParameter encp = new EncoderParameter(
    System.Drawing.Imaging.Encoder.Quality,

    (int)99 );

    encps.Param[0] = encp;

    pic.Save(Response.OutputStream,icf[2],encps);
    Ersin Gençtürk, Apr 29, 2005
    #1
    1. Advertising

  2. Ersin Gençtürk

    Guest

    Your code looks OK.

    I've been able to get nice quality images with jpegs. When I do so, I
    set the encoder quality to 100L and ColorDepth to 24L. However, I
    really can't say how well this would work (or even if it's appropriate)
    for a bitmap image. I get decent images for gifs, but I can't remember
    whether playing with the encoder settings actually made a tremendous
    difference with gif images.

    Bill E
    , Apr 29, 2005
    #2
    1. Advertising

  3. I am generating jpeg outputs.but even it is set to best quality, not really
    the best quality of the jpeg.I can see the compression very clearly when all
    the attributes set to maximum.I am drawing black text on a white background
    so It is more visible.

    <> wrote in message
    news:...
    > Your code looks OK.
    >
    > I've been able to get nice quality images with jpegs. When I do so, I
    > set the encoder quality to 100L and ColorDepth to 24L. However, I
    > really can't say how well this would work (or even if it's appropriate)
    > for a bitmap image. I get decent images for gifs, but I can't remember
    > whether playing with the encoder settings actually made a tremendous
    > difference with gif images.
    >
    > Bill E
    >
    Ersin Gençtürk, Apr 29, 2005
    #3
  4. The problem is, you're not seting the compression. Therefore, it is using
    the default.

    --
    HTH,

    Kevin Spencer
    Microsoft MVP
    ..Net Developer
    What You Seek Is What You Get.

    "Ersin Gençtürk" <ers[spam]@gencturk.org> wrote in message
    news:O6ovr%...
    >I am generating jpeg outputs.but even it is set to best quality, not really
    > the best quality of the jpeg.I can see the compression very clearly when
    > all
    > the attributes set to maximum.I am drawing black text on a white
    > background
    > so It is more visible.
    >
    > <> wrote in message
    > news:...
    >> Your code looks OK.
    >>
    >> I've been able to get nice quality images with jpegs. When I do so, I
    >> set the encoder quality to 100L and ColorDepth to 24L. However, I
    >> really can't say how well this would work (or even if it's appropriate)
    >> for a bitmap image. I get decent images for gifs, but I can't remember
    >> whether playing with the encoder settings actually made a tremendous
    >> difference with gif images.
    >>
    >> Bill E
    >>

    >
    >
    Kevin Spencer, Apr 29, 2005
    #4
  5. Ersin Gençtürk

    Guest

    Ersin,

    I can't say if you're getting better or worse quality than I. Perhaps
    we should trade jpg images to see. I'm sending you (to the address
    shown on your newsgroup post) some jpg and emf images that I produced
    with a .NET charting tool that I made. Take a look and see if they're
    any better or worse than the ones you're producing. I know that the
    jpg images were not very good when printed but looked good on the
    screen. I think that the emf files print fairly well. These are the
    best quality images that I've been able to produce so if they're no
    better than yours than I can't really help you.

    Bill
    , Apr 29, 2005
    #5
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Chris D

    Thumbnail Image Quality Issues

    Chris D, Nov 18, 2003, in forum: ASP .Net
    Replies:
    0
    Views:
    324
    Chris D
    Nov 18, 2003
  2. Chris D

    Thumbnail Image Quality Issues

    Chris D, Nov 19, 2003, in forum: ASP .Net
    Replies:
    6
    Views:
    1,676
  3. Kim Bach Petersen

    Image quality on generated images

    Kim Bach Petersen, May 7, 2005, in forum: ASP .Net
    Replies:
    2
    Views:
    350
    Kim Bach Petersen
    May 7, 2005
  4. =?Utf-8?B?a2Zpcg==?=

    image quality on Image control

    =?Utf-8?B?a2Zpcg==?=, Dec 14, 2005, in forum: ASP .Net
    Replies:
    0
    Views:
    344
    =?Utf-8?B?a2Zpcg==?=
    Dec 14, 2005
  5. Daniel Mark
    Replies:
    1
    Views:
    702
    Fredrik Lundh
    Sep 25, 2006
Loading...

Share This Page