CRUNCHJPGS(1)
π crunchjpgs.pl β like, the whole manual, bestie β¨
okay so this is crunchjpgs.pl from the User Contributed Perl Documentation section, and it's genuinely one of my fave little tools. it squeezes all your JPG images inside a PDF so the file stops being a whole problem. let's get into it π«Ά
πΈ NAME πΈ
crunchjpgs.pl β compress all JPG images in a PDF</p> π
like, that's it. that's the whole vibe. all the JPGs, in a PDF, made smaller. slay.
β¨ SYNOPSIS β¨
crunchjpgs.pl [options] infile.pdf [outfile.pdf]
Options:
-j --justjpgs make script skip non-JPGs
-q --quality select JPG output quality (default 50)
-s --scale=num select a rescaling factor for the JPGs (default 100%)
-m --scalemin=size don't scale JPGs smaller than this pixel size (width or height)
-O --only=imnum only change the specified images (can be used mutliple times)
-S --skip=imnum don't change the specified images (can be used mutliple times)
-o --order preserve the internal PDF ordering for output
--veryverbose increases the verbosity
-v --verbose print diagnostic messages
-h --help verbose help message
-V --version print CAM::PDF version
so you give it an infile.pdf, and if you want you can also hand it an outfile.pdf for where the good stuff goes. and yes, that typo up there in --only and --skip β "mutliple" β is literally in the original, i'm not fixing it, it's part of the lore now π
π the values for --scale π
these are the only numbers --scale will accept, no cap:
1 100%
2 50%
4 25%
8 12.5%
so it's like a halving ladder. 1 is full size, 8 is itty bitty. π
π¦ about imnum π¦
imnum is a comma-separated list of integers indicating the images in order that they appear in the PDF. and how do you find out those numbers? run listimages.pl, it'll tell you. iykyk π
π₯ DESCRIPTION π₯
first things first, the vibe check: this script requires the ImageMagick convert program to be available, so make sure that's on your system or it's not gonna have a good time π
what it does is tweak all of the JPG images embedded in a PDF to reduce their size. and the reduction can come from two places β cranking up the compression, and/or rescaling the whole image. and the options give you full control over which images get altered, so you're never stuck doing a blanket edit you didn't ask for. iconic behaviour, honestly π
ngl, it's a "tweak" script β the whole point is making the embedded JPGs smaller, and both the compression and the rescale knobs are how you get there πΈ
β SEE ALSO β
go look at these when you're done here, they're all in the same little family:
CAM::PDFlistimages.plextractallimages.plextractjpgs.pluninlinepdfimages.pl
π AUTHOR π
see CAM::PDF. that's it, that's the author section. go check the CAM::PDF docs π
and that's the whole page, bestie π ~ fin ~ β this little beauty comes to you from perl v5.42.3, dated 2013-08-15, so yeah, it's vintage but it still eats πβ¨π
π¦ where this page comes from
- nixos 26.05: perl5.42.3-CAM-PDF 1.60
- nixpkgs unstable: perl5.42.3-CAM-PDF 1.60
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms