Here's the format of the diff_image to start with: {Pdf: Portable Document Format (+R+W+M)}. I had already tried converting the images to png on import, but it didn't have much of an effect. Not sure why I didn't think of converting diff_image as well.
Here's what I did that cut the file size of the pdf in half:
Thanks for the guidance on converting the output to png.
Here's what I did that cut the file size of the pdf in half:
diff_image.HasAlpha = false;
diff_image.Format = MagickFormat.Png;
diff_image.Quality = 95;
diff_images.Add(diff_image);
The original pdf was 2.53MB and after the above addition it became 1.38MB. However the odd part is when I changed the image quality to 5 the pdf was the same 1.38MB. I also output the png diff_image by itself and compared the difference between the output at quality=5 and quality=95. The quality 5 was 674KB and quality 95 was 167KB. So the pdf shrunk by 45% and the png shrunk by 75%. I'm wondering why the png shrunk so much, but the pdf didn't.Thanks for the guidance on converting the output to png.