This is a really tricky one. I actually made a video comparing all the free tools I could find last summer, scoring them on how well they converted three different sorts of image and whether they generated Pattern Keeper compatible files. I made this table in Notion with the results. It took ages and was very tedious 😆 https://www.notion.so/Cross-stitch-converter-comparison-b08b470ea7954e9d8ee46f1bf2e51767?pvs=4
As you can see there was no perfect tool that did everything, and not many of them were much use in terms of Pattern Keeper! The other complication being backstitch, as PK doesn't handle that regardless.
What definitely does make good PK files is WinStitch, which isn't free but is fairly affordable if you plan to make a habit of this. I've not really used its image conversion feature but it's popular software so there are probably examples made with it all over the internet. The demo might be worth a look to see how it works, if you don't find anything free.