I completely agree with alienlandingpad. When I first purchased the M9 I did struggle with getting good photos at first, but then read on line the best settings and how to take advantage of its various features. Now I get mostly really good to stunningly good pictures.
Here are some tips that work for me:
1. When in normal camera mode, (so right bottom icon on the camera screen selected as CAMERA), in settings try setting the resolution to the lowest of the 3 settings if in low light or florescent light settings. It's amazing, but setting to medium or highest resolution often produces inferior pictures in normal camera mode in such environments. I believe it must be due to the mathematics behind the post-picture processing. They messed up big somehow.
In RAW camera mode however (RAW CAMERA selected from rightmost bottom icon), definitely do the OPPOSITE. In RAW CAMERA mode, the highest resolution is instead always the best (Just hold it really still). Which is why I'm sure it's the post processing mathematics that occurs in normal camera mode that is messed up.
2. mostly stick to RAW CAMERA mode if any kind of non-daylight setting and you don't want the post image processing to muck things up. Even in daylight settings I found that I could see MANY more detailed leaves of a tree in RAW CAMERA mode than normal camera mode. Again, in RAW mode use highest resolution. Try out some comparisons yourself.
Don't worry about having to manually set anything. RAW mode does not mean you have to manually set the ISO and such. You still get all of the auto-settings by default. Just any post-image processing is skipped.
3. The M9 camera apparently has no motion stabilization. You have to hold the camera extremely still to get sharp pictures in most settings. The brighter the light the less that is true. But if any any type of low light setting, you have to brace the camera against a light pole, counter top, etc... Just holding your breath and trying to stay still even doesn't quite cut it. Instead, brace the camera against something solid in low light settings. The other day I came upon a young Western Diamondback rattlesnake while biking here in Texas. I immediately got off my bike and snapped some pictures....but I was a bit nervous obviously and couldn't quite hold steady. STILL it produced a somewhat acceptable picture. Just not good enough for my taste. If I'd had the courage (and stupidity) I would have held it on the ground close to it to get a stellar picture.
4. HDR is awesome in scenes containing a mix of shadows AND bright objects at the same time. BUT AGAIN, BRACE THE CAMERA AGAINST SOMETHING SOLID!!! Especially in HDR mode!
5. make sure to tap the screen on what you want to focus on just before snapping the picture. If not using HDR, then consider if you want a slower shutter speed and larger aperture to let in more light in which case tap something dark, or if wanting a quicker shutter speed in which case tap something bright. But in either case, something within the area on which you want the camera to focus for the sharpest details.
Oh and all that said, I had the Galaxy S6 Edge for a month before switching to the M9 (that's another story), and I can say truly that the Edge got the camera right for auto just point-and-shoot mode. Their pictures were so crisp that I could swear I was just looking through a pane of glass at the original image. With just all auto settings. And the video was incredibly crisp as well.