Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

208
Vistas
Ghostscript : Filter out image streams by criteria

I have pdf files created on Adobe InDesign, which contains several kinds of object.

I wish to "Remove everything except the largest art (background)" and save to a new file.

This can be achieved almost perfectly with combination of gs command options like this:

$ gs -q -o "${outfile}" -sDEVICE=pdfwrite -dFILTERTEXT -dFILTERVECTOR "${infile}"

However, occasionally there are several raster images which I'd like to filter by some criteria. The image I wish to keep, always have following properties that distinguish it from the unwanted ones:

  • it is always the largest in data size
  • it is always the largest by dimension
  • it is always a 1bit binary images, sometimes compressed with CCITT g4 or LZW

Is there a way to filter certain images by criteria, by using gs command or any other tools perhaps?

This link guided me to using the filter options, but could not work out how I could extend the functionality further: How can I remove all images from a PDF?

The code runs on a Mac/Ubuntu envrironment.

about 4 years ago · Juan Pablo Isaza
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda