If I make a painting based on someone's photo (nature photography) and it is recognisable, do I have to pay to the author of the photo (or do I breach any copyright law), or is it enough that I mention that the painting is inspired by this photo and give the author's name?
"Only the owner of copyright in a work has the right to prepare, or to authorize someone else to create, a new version of that work."
Copyright in Derivative Works and Compilations
So if you have not been granted authorization, you are violating the right of the owner. It's always recommended that you get permission. Practically speaking, if the owner does not give you permission, there is probably someone else with a similar photo who will!
Pretty famous recent case: Barack Obama "Hope" poster