I also did some tests with the K-50 to see what you can get out of a JPEG (not the RAW).
For close-ups its important to use a tripod, a cable release (or remote control), and to switch off shake reduction (all three). I didn't get reasonable results until the remote was used.
Camera = K-50 + DA40 Limited + hood
Constant lighting, tungsten spot 1x
Tripod
Shake Reduction = off
Cable release
Manual focus
Aperture = F 11.0
ISO = 100
White balance = tungsten
Image format = JPEG = Max quality, 16M, 4928x3264 px
Post processing = brightness, contrast, saturation (not much), crop to 2500x2500 px
The image shown here is resized to 700x700 px which adds a bit of extra blur (JPEG, 20% compression).
I also must compare this to the K-5II under the same circumstances. Still learning.