The question is, do you really need any additional media sizes in addition to the default ones? I understand some projects may need more than those default four (thumb, medium, large, full), but usually it is just a display of inexperience. For example I have 5 WP themes on ThemeForest and none of them is using custom sizes. I stick just to default ones. And in this case, you shouldn’t programatically change their dimension at all. You just add to your theme documentation chapter about how your users should change them manually if needed.
The fact that you do not want to rely on 3rd party plugins is great, this is my philosophy as well when it comes to WP development, but you actually need skills to back this up.
I already shared with you all the functions you need to display any image in any size you want in my first reply.
You are real author in themeforest so If you dont know the solution, I am sure nobody dont know in google.
Thanks for flattery, but I am not the most knowledgeable WP person. There are MANY people who know much much more about WP development than I do.
Again, if you can’t find answers on google then you are asking wrong questions. Maybe the way you are trying to do it (anything, not just this particularly thing) is fundamentally wrong and you should rethink it from the ground.
And if you really can’t go without having the help from community then at least use some appropriate channels like https://stackoverflow.com for example.
There are much more skilled community and it is actually the right place to get help on stuff like this.