delete empty bounding boxes

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Post Reply
Arlene

delete empty bounding boxes

Post by Arlene »

does imagemagick have the ability to identify and delete empty bounding boxes?
User avatar
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Re: delete empty bounding boxes

Post by anthony »

What is your defination of a 'bounding box' in your problem?
Example?
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
Arlene

Re: delete empty bounding boxes

Post by Arlene »

it is the rectangle that contains all of the elements that make up a single graphic. If you delete the bounding box it will delete the entire graphic but in some cases there are these extraneous bounding boxes that are not linked to the graphic itself but are there when you open the graphic and have nothing in them so you can delete them without affecting the graphic or the real bounding box contain the graphic elements.
User avatar
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Re: delete empty bounding boxes

Post by anthony »

Your defination is reasonable but not quite complete.

Bounding Box is actually the definate area in which a POSTSCRIPT image is drawn.
It usally includes the whole drawn elements but not always.

I have seen postscript files with drawing conrtruction that extent beyond the bounding box. Sometime these are left as part of the final image, more commonely they are removed and trashed (or make white, so as to invisible on a printed page).

Usally a postscript to raster convertor will just trim the result to the bounding box, and return that, removing any and all offset information on where the bounds were on the original page. But not always.

Now not bounding boxes have NOTHING to do with erasing graphics, or positioning them, it is only a guide as to the location of the graphic on a postscript rendered page. That is all.

With regards to IM, it just gets the result from the ghostscript delegate, and does not retain any bounding box information. At least that is my understanding.

This was why I asked, as IM itself does not deal with bounding boxes, as such.
It could, but doesn't.
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
Post Reply