ImageEn for Delphi and C++ Builder ImageEn for Delphi and C++ Builder

 

ImageEn Forum
Profile    Join    Active Topics    Forum FAQ    Search this forumSearch
 All Forums
 ImageEn Library for Delphi, C++ and .Net
 ImageEn and IEvolution Support Forum
 ImageEnVect Adjust Bitmap Issue

Note: You must be registered in order to post a reply.
To register, click here. Registration is FREE!

View 
UserName:
Password:
Format  Bold Italicized Underline  Align Left Centered Align Right  Horizontal Rule  Insert Hyperlink   Browse for an image to attach to your post Browse for a zip to attach to your post Insert Code  Insert Quote Insert List
   
Message 

 

Emoji
Smile [:)] Big Smile [:D] Cool [8D] Blush [:I]
Tongue [:P] Evil [):] Wink [;)] Black Eye [B)]
Frown [:(] Shocked [:0] Angry [:(!] Sleepy [|)]
Kisses [:X] Approve [^] Disapprove [V] Question [?]

 
Check here to subscribe to this topic.
   

T O P I C    R E V I E W
andyhill Posted - May 02 2016 : 20:11:27
I want to load an image, change it's color depth, resize it and save.

All attempts yield larger files than any other image processing software that I have used using the same source image and image parameters.

eg.
Corel yields 13k file
ImageEn yields 40k file

All with the same settings ?

Please advise - thanks


      Thumb.ClearAll;
      // Set DPI
      Thumb.IO.Params.DpiX:= 96;
      Thumb.IO.Params.DpiY:= 96;
      // Set to 256 colors
      Thumb.IO.Params.BitsPerSample:= 8;
      Thumb.IO.Params.SamplesPerPixel:= 1;
      //
      Thumb.IO.LoadFromFile(OpenPictureDialog1.FileName);
      Thumb.RemoveAlphaChannel;
      // Set again just in case it was blown away by load
      // Set DPI
      Thumb.IO.Params.DpiX:= 96;
      Thumb.IO.Params.DpiY:= 96;
      // Set 256 colors
      Thumb.IO.Params.BitsPerSample:= 8;
      Thumb.IO.Params.SamplesPerPixel:= 1;
      // Set Size
      Thumb.Proc.Resample(100, 100, rfFastLinear, True);
      Thumb.Update;
      //
      Thumb.IO.Params.JPEG_Quality:= 80;
      Thumb.IO.SaveToFileJpeg(fMain.UserAppDataPath+'Work\Thumbnail.jpg');


Andy
2   L A T E S T    R E P L I E S    (Newest First)
andyhill Posted - May 03 2016 : 16:25:48
That did it - thanks

Andy
xequte Posted - May 03 2016 : 01:01:41
Hi Andy

Also strip the meta data before saving:

Thumb.IO.Params.ResetInfo;

{
// None of this code before loading is needed

      Thumb.ClearAll;
      // Set DPI
      Thumb.IO.Params.DpiX:= 96;
      Thumb.IO.Params.DpiY:= 96;
      // Set to 256 colors
      Thumb.IO.Params.BitsPerSample:= 8;
      Thumb.IO.Params.SamplesPerPixel:= 1;
      //
}
      Thumb.IO.LoadFromFile(OpenPictureDialog1.FileName);

// Not needed for JPEGs
{
      Thumb.RemoveAlphaChannel;
}

      // Set DPI
// This won't affect the size of the image
      Thumb.IO.Params.DpiX:= 96;
      Thumb.IO.Params.DpiY:= 96;

// Not needed for JPEGs
{
      // Set 256 colors
      Thumb.IO.Params.BitsPerSample:= 8;
      Thumb.IO.Params.SamplesPerPixel:= 1;
}

      // Set Size
      Thumb.Proc.Resample(100, 100, rfFastLinear, True);

// Not needed
{
      Thumb.Update;
}

// Remove the meta-data
      Thumb.IO.Params.ResetInfo;

      Thumb.IO.Params.JPEG_Quality:= 80;
      Thumb.IO.SaveToFileJpeg(fMain.UserAppDataPath+'Work\Thumbnail.jpg');



Nigel
Xequte Software
www.xequte.com
nigel@xequte.com