When to upload
If the image was posted to Yande.re from another site, such as the artist's Pixiv or homepage, and that page is still available, upload from that site instead. Only upload from Yande.re if it is a scan. On Yande.re, pictures that aren't scans should have a Source field, while scans do not, but you can double-check by using a reverse image search.
The highest quality version of the Yande.re post can be found in the "Download PNG" link, or, if that isn't there, then the "Download larger version" link. Use this link as the Source on Danbooru's upload page, or open it in your browser and use the bookmarklet.
Note: One caveat to the above is if the file size of the fullsize image is greater than 35MB, which is the limit for Danbooru. Under those circumstances, using the next best image is allowed. This will be the JPEG version if it exists, and the SAMPLE image if it does not. See Image Link Format below for an explanation of those terms.
Image link format
The URL of the image you are uploading should begin with
[nodtext]https://files.yande.re/image/[/nodtext]. If it begins with
[nodtext]https://files.yande.re/sample/[/nodtext], it is an image sample instead of the full version. If it begins with
[nodtext]https://files.yande.re/jpeg/[/nodtext], it is the JPEG version when a superior PNG version is available.
The image URL may look strange (for example, it may contain a long list of tags at the end) but don't adjust it; After upload, Danbooru will automatically display a prettified version as the source if you leave it as-is.