# Force \includegraphics use specific file extension for all document [duplicate]

If I have in the folder `figure.pdf` and `figure.png`
`\includegraphics{figure}` command will use `figure.png`, if I need `*.pdf` I could force to use it by typing: `\includegraphics{figure.pdf}`
But if I need sometimes to compile document with all figures with `png` extension or `pdf`, what should I change in `graphics` package settings?