One option is to call CutyCapt . This requires an X server, but as indicated in the docs, you can use Xvfb (headless virtual X server) to fill this position. Try to reuse the same Xvfb instance each time to save resources.
-, , , webthumb. , , , CutyCapt.