How to copy an image to the clipboard from a file using command line?

Solution 1:

Use the -t option to specify the content type, like

xclip -selection clipboard -t image/png -i example.png