Jump to content

Editing images within a pdf, how to avoid degradation / pixelation


Recommended Posts

I wanted to edit a graphic flaw in the F-86F Flight manual PDF (using only free software). Any method I've found to extract the image, the image is pixelated. Comparison:

 

Left: Original image in pdf reader magnified 1600% (Ignore drop shadow)

Small inset: Original image in pdf reader at normal viewing magnification 100%.

Right: Modified (added red dot) reinserted image in PDF reader magnified 1600%

 

uuagAFQ.png

 

The diagonal edges are smooth in original, but pixelated after replacing the image inside the pdf. More precisely, any image I manage to extract from the pdf with any method I found is pixelated. True, the pixelation is hard to see un-magnified but the result is a degradation (and texts becomes less legible).

 

What I did:

  • I extracted the image from the pdf.
  • Added a single red spot to identify the changed image.
  • Changed image within the PDF using the free ApowerPDF editor with the "replace image" command.

 

I get the same pixelated extracted image using either an online webpage (pdf to jpg) or using the free freePDF-XChange pdf editor to extract images from the pdf. ApowerPDF editor don't allow image extractions.

 

I don't think I get a 'bad' image, I think filtering is applied somewhere within the PDF format that I need to activate. Is this what's is happening? Could I apply some filter on the image before adding it to the PDF to make it look better?

 

~

 

What I want to do is to edit an image within the pdf, however so slightly, and have it look as nice and un-pixelated as the original.


Edited by -0303-

Intel Core i7 3630QM @ 2.40GHz (Max Turbo Frequency 3.40 GHz) | 16.0GB Dual-Channel DDR3 @ 798MHz | 2047MB NVIDIA GeForce GT 635M | 447GB KINGSTON SA400S37480G (SATA-2 (SSD))

Link to comment
Share on other sites

Are you extracting it as an SVG format? what page on the manual is that?

hsb

HW Spec in Spoiler

---

 

i7-10700K Direct-To-Die/OC'ed to 5.1GHz, MSI Z490 MB, 32GB DDR4 3200MHz, EVGA 2080 Ti FTW3, NVMe+SSD, Win 10 x64 Pro, MFG, Warthog, TM MFDs, Komodo Huey set, Rverbe G1

 

Link to comment
Share on other sites

Page 178 in manual. I was extracting here: pdf to jpg.

 

I've since discovered that GIMP can import PDF directly. GIMP asks for pixels / inch when importing. Setting it to 600 I get a beautiful smooth picture.

 

GIMP has a problem though. There's the image and there's a second image, a drop-shadow. For some reason GIMP merges them instead of doing the sensible thing and giving me both. I found a workaround. I opened the PDF in an PDF editor (freePDF-XChange), deleted the drop shadow and saved the PDF. Opening it again in GIMP, I get a white-background clean image, without drop-image 3D effect.

 

I've never edited PDF's before. I've just realized that PDF operates with vectors, only bitmaps when it has to. I noted when I asked GIMP to save a PDF it wanted to "convert as much as possible to vectors".

 

If you know good ways (free software) to edit PDF's I'm interested (like extracting images). I know I can do what I want to do now, using GIMP, but there may be easier ways to do it.

Intel Core i7 3630QM @ 2.40GHz (Max Turbo Frequency 3.40 GHz) | 16.0GB Dual-Channel DDR3 @ 798MHz | 2047MB NVIDIA GeForce GT 635M | 447GB KINGSTON SA400S37480G (SATA-2 (SSD))

Link to comment
Share on other sites

So I found a good way to extract images from a PDF and then create new bitmaps with selectable resolution (suitable for reinsertion into PDF):

 

  • import PDF to Inkscape
  • export SVG from Inkscape
  • import SVG to GIMP (where choosing DPI allows limitless choice of resolution)

Inkscape Step by step:

 

  • "open file" CTRL + O, choose PDF file
  • "PDF import Settings": Select PDF page no and select Poppler
  • "ungroup" Rightclick high on canvas (to include all objects I think), chose "ungroup" (make sure no "ungroup"ed is left)
  • Select the object(s) to export
  • "Resize page to drawing or selection" (File → Document Properties) or Ctrl + Shift + R
  • "Invert selection" (Edit → Invert selection) or !, and Del all other objects.
  • "Save As" with Ctrl + Shift + S, choose name and save

GIMP step by step

 

  • "open file" CTRL + O, choose SVG file
  • "Resolution" select DPI (higher number, higher resolution), hit RETURN
  • Done, object(s) is on transparent canvas

Going by way of Inkscape is better than direct import of PDF to GIMP because Inkscape allows choice of which object(s) (one or more) to import whereas GIMP takes every object on the pdf page every time.


Edited by -0303-

Intel Core i7 3630QM @ 2.40GHz (Max Turbo Frequency 3.40 GHz) | 16.0GB Dual-Channel DDR3 @ 798MHz | 2047MB NVIDIA GeForce GT 635M | 447GB KINGSTON SA400S37480G (SATA-2 (SSD))

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...