Atalasoft
Welcome to Atalasoft Community Sign in | Join | Help
in

Best way to resize/resample an image

Last post 07 Jul 2009, 3:26 PM by loufranco. 1 replies.
Sort Posts: Previous Next
  •  26 Jun 2009, 2:05 PM 18731

    Best way to resize/resample an image

    I need to resize/resample an image by about 1%. The purpose is really to alter the binary content just in case there might be a chance of something embedded or appended to the image. But when I apply the Resample command to an image (increase the size by 1%), the file size changed significantly (e.g. ~30%) and the image quality deteriorates significantly.

    Can you recommend a good way to accomplish our goal? Thanks so much.

  •  07 Jul 2009, 3:26 PM 18794 in reply to 18731

    Re: Best way to resize/resample an image

    Can you just add more pixels to the end instead of resampling.  Use the ResizeCanvasCommand -- it adds more pixels to any edge, but doesn't resample the image -- which is causing your quality problem.

    A 1% increase in image size should result in a similar increase in file size. Probably you are encoding it differently that the original.  You don't say what kind of file, but a very common thing with TIFFs is that we encode as stripped TIFF by default (for fast reading), but if you want to have the smallest possible size, then you should set the StripSize property of your TiffEncoder to the height of the image.  This will be the smallest possible size.

    Another common thing is that maybe you have changed the PixelFormat from the original -- make sure that if the original is 1bpp, that you return it to 1bpp after you have done whatever processing you needed to do. 

View as RSS news feed in XML