I have obtained these images by scanning the drawings in just two colours.
I see your comments about the alternate graphicsmagick but I would prefer to stick with imagemagick.
Using comments from both replies I altered the Perl so that the jpg and pdf were saved as before and then saved again using LZW compression and a quality of 75. This gave four files. The code follows
$mod_file_name = $file_name_jpg; $mod_dp = '-' . $jv . 'pc.'; # normal $mod_file_name =~ s/\./$mod_dp/; $rc = $img_copy->Write($dir_name . '\\' . $mod_file_name); $mod_file_name =~ s/jpg/pdf/; $rc = $img_copy->Write($dir_name . '\\' . $mod_file_name); # compressed $mod_file_name = $file_name_jpg; $mod_dp = '-' . $jv . 'pc-compressed.'; $mod_file_name =~ s/\./$mod_dp/; $rc = $img_copy->Write(filename => $dir_name . '\\' . $mod_file_name, +compression => 'LZW', quality => 75); $mod_file_name =~ s/jpg/pdf/; $rc = $img_copy->Write(filename => $dir_name . '\\' . $mod_file_name, +compression => 'LZW', quality => 75);
For one jpg file I obtained the four files for:
1. The original jpg file
2. After using Scale to reduce the size of the image by 2 (in x and y)
The file sizes were for full size
jpg 1,099 kb
pdf 1,331 kb
jpg compressed 742 kb
pdf compressed 2,144 kb
The file sizes were for half size
jpg 304 kb
pdf 660 kb
jpg compressed 304 kb
pdf compressed 660 kb
This was not what I was expecting since:
For full size – although the compressed jpg was smaller than the uncompressed version, the compressed pdf was nearly twice as large as the uncompressed version
For half size –there was no change between the compressed and uncompressed version.
Does it make sense that the compressed pdf is larger than the original and why does compression seem to have effect after scale had been used on the original image?

In reply to Re^2: Size problem of pdf file using ImageMagick by merrymonk
in thread Size problem of pdf file using ImageMagick by merrymonk

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.