I could put my images anywhere it seems, and it just works fine. However, Next.JS seems to recommend to put the images into the public folder. What's the advantage here?
If you have your static files in the public folder, it would be easier to import them elsewhere. Files inside public can be referenced by your code starting from the base URL (/).
For example, if you add an image to public/me.png, the following code will access the image:
import Image from 'next/image'
function Avatar() {
return <Image src="/me.png" alt="me" width="64" height="64" />
}
export default Avatar
More info about that can be found here: https://nextjs.org/docs/basic-features/static-file-serving