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
 Usage of TImageEnMView.RemoveBlankPages with JPG

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
aleatprog Posted - Oct 16 2020 : 12:19:42
Hi,

even if TImageEnMView.RemoveBlankPages works only with 1bit bitmaps, is there a workaround to let the function check 24bit bitmaps?

E.g. is it possible to create a 1bit copy of each bitmap, let the copy been checked by RemoveBlankPages and get the idx of all removed pages in order to delete the 24bit originals from TImageEnMView?

Al
5   L A T E S T    R E P L I E S    (Newest First)
xequte Posted - Oct 25 2020 : 16:06:57
Hi

Can you please email me a selection of your images for testing.

Nigel
Xequte Software
www.imageen.com
aleatprog Posted - Oct 25 2020 : 07:49:28
Nope. : )

I don't know why, even with a value of 0.99 or 1.0 RemoveBlankPages doesn't work with color bitmaps in my app, meanwhile RemoveBlankPages works perfectly with B/W bitmaps. That's why I searched for a workaround for color bitmaps.
xequte Posted - Oct 25 2020 : 01:09:58
Thanks Al,

Did it not work well enough with something like:

// Remove any pages that are 95% blank
ImageEnMView1.RemoveBlankPages( 0.05 );

Nigel
Xequte Software
www.imageen.com
aleatprog Posted - Oct 24 2020 : 17:16:07
Thank you for the hint, Nigel. The following code works for me:

var
  i: Integer;
  IEBitmap: TIEBitmap;
  proc: TImageEnProc;
  Percentage: Double;
  cl: TRGB;
begin
  for i := ImageEnMView1.ImageCount -1 downto 0 do
    begin
      IEBitmap := TIEBitmap.Create;
      try
        ImageEnMView1.CopyToIEBitmap(i, IEBitmap, True);
        ImageEnMView1.ReleaseBitmap(i);
        proc := TImageEnProc.CreateFromBitmap(IEBitmap);
        proc.ConvertTo(ie1g, ieptFixedBW, iedtSolid);
        Percentage := proc.GetDominantColor(cl);
        proc.Free;
        if Percentage = 100 then
          ImageEnMView1.DeleteImage(i);
      finally
        IEBitmap.Free;
      end;
    end;
end;

Al
xequte Posted - Oct 18 2020 : 17:41:12
Hi Al

RemoveBlankPages uses the GetDominantColor algorithm to find the percentage of the image of a certain color.

There is no requirement for it to be 1bit. It is actually designed for 24bit bitmaps:

https://www.imageen.com/help/TImageEnProc.GetDominantColor.html

Nigel
Xequte Software
www.imageen.com