[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 667
  • Last Modified:

TGifImage (Melanders) - how to set best quality for bitmap to gif conversion

Hi I'm using Melanders TGifImage (on D2005) and assigning a bitmap to a gif but the resulting gif just looks 'orrible. In the GifImage unit it says the default settings are the fastest but worst - does anybody know which settings give the best conversion results please? (Don't care about the speed at all just the quality). Sorry I know nothing but the basics for graphics!
Thanks
P

from code:
//: Default color reduction methods for bitmap import.
  // These are the fastest settings, but also the ones that gives the
  // worst result (in most cases).
  GIFImageDefaultColorReduction: TColorReduction = rmNetscape;
  GIFImageDefaultColorReductionBits: integer = 8; // Range 3 - 8
  GIFImageDefaultDitherMode: TDitherMode = dmNearest;

  //: Default encoder compression method.
  GIFImageDefaultCompression: TGIFCompression = gcLZW;

  //: Default painter thread priority
  GIFImageDefaultThreadPriority: TThreadPriority = tpNormal;

  //: Default animation speed in % of normal speed (range 0 - 1000)
  GIFImageDefaultAnimationSpeed: integer = 100;

  // DoAutoDither is set to True in the initializaion section if the desktop DC
  // supports 256 colors or less.
  // It can be modified in your application to disable/enable Auto Dithering
  DoAutoDither: boolean = False;
0
Pandora
Asked:
Pandora
  • 2
1 Solution
 
Slick812Commented:
if you are reducing a 24 bit muticolor bitmap (photo Image) to 8 bit in the TGif Image you might try and set the image color reductions to -

  GIFImageDefaultColorReduction  to  rmQuantize // or  rmQuantizeWindows for standatd color inclusion
 
  GIFImageDefaultDitherMode   to  dmFloydSteinberg  // dmBurkes is also good, and the others give various results depending on the image

  DoAutoDither  to True

but the

TColorReduction = rmNetscape
and
TDitherMode = dmNearest;

do NOT give pleasing results for photographic images

you should read the help files for TGIFImage, I beleive it has some about this
0
 
Slick812Commented:
also, the color reduction settings are mutiple, not just one setting offered, so each setting has a use, depending on what image you start with and what GIF image you want to end with, so you may just experiment with the various settings to see which ones are best suited for your input image and your technical requirements (or maybe visual requirements) for your Gif file, ,  Each of the different TDitherMode settings has a slightly different rendering for closely matched colors like a color gradient, , as to which looks best? but that visulal judgement is up to the viewer
0
 
PandoraAuthor Commented:
ooh thats much better! Thanks slick, :)
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now