Pages EPUB export converts JPEGs with rounded corners to larger PNGs
Size increase in EPUB Document from Pages
There are many topics here discussing how the size of a Pages document increases greatly when exported as an EPUB file (or as a PDF). Sadly most (all?) of these are closed yet there is little hard explanation of what causes the problem. I created this topic to record one concrete reason.
My Pages document contains quite a lot of large (half-page and bigger) photos, inserted as JPEG files with the JPEG quality set quite low to reduce the file size. An exported PDF is rather smaller than the Pages file but the EPUB was twice as big. Some digging showed that the JPEG files in the Pages document had been exported as PNG files in the EPUB file with the PNG files being (understandably) much bigger than their JPEG equivalents.
The JPEGs in the Pages file all have slightly rounded corners (just from dragging the little green square at the top-left corner of their frame). The PNGs mimic this using transparent corners. I deduce that EPUB doesn't support any on-the-fly mechanism for masking the image shape so Pages retains the appearance with transparency by changing to PNGs (JPEG does not support transparency) - but they're much bigger.
Removing the tiny curved corners reduced my EPUB size by about a third, leaving it not too much bigger than the Pages file. I'm to criticising Pages here because it faithfully reproduced the document's style but the cost in file size is startling.
Hope this helps.
MacBook Pro (M1 Max, 2021)