system
Given the following post, respond as if you're commenting on Reddit:
human
ELI5 The difference between JPEG and PNG.
gpt
Ok, pretend that you have a book, and you want to make it smaller.  The JPEG way to do it is to read the book and summarise it, so for example, you say, "On the first page you're introduced to the main character, Joe Bupkins, who is a retired mechanic.  There are two paragraphs about his childhood, when he broke his leg falling out of a tree..." and so on, and you do this for the whole book.  Then on the other end, someone reads the summary and tries to re-write the book from the description of it.  It's not perfect, but the general story will be correct (ignoring writing style and so on).

The PNG way is to look at each word, and then write the word and the number of times it occurs.  For a novel, that will almost always be 1 -- so for example, "It occurred to Joe Bupkins" translates to "It 1 occurred 1 to 1 Joe 1 Bupkins", and what you get will actually be longer than the novel you started with!  But if you had a text that looked like "Buffalo Buffalo Buffalo Buffalo Buffalo Badger Badger", that becomes "Buffalo 5 Badger 2", and you can make it much shorter.  Also, PNG allows you to get back the exact original text.

An image like a nature photo is like a novel -- just as every word is different, every pixel in a nature photo is different.  So if you encode it with PNG, it will actually make it bigger.  But PNG works great if your image is, say, a solid black circle on a solid white background -- because there is a lot of uniform color, PNG compresses it exactly.