Closest thing I've found is
https://www.codeandweb.com/physicseditor (unfortunately not free), which is a general purpose editor for creating 2D collision shapes for use in various game engines. It even lets you edit common properties like elasticity and friction.
It has many export formats but one is JSON which looks like this:
- {l Code}: {l Select All Code}
{
"betty": [
{
"shape": [ 1, 63 , 8, 54 , 11, 63 , 2, 73 ]
} ,
{
"shape": [ 67, 56 , 54, 64 , 57, 56 , 67, 51 ]
} ,
...
Presumably those integers are ids for the actual vertices. Depending on what your engine/game is expecting, it's pretty easy to parse something like that.
Since you mention rectangles, it seems your engine/game is using AABB collision, where this format isn't ideal, as you'd want just pairs of x/y coordinates describing those rectangles. Unfortunately there doesn't seem to be a general purpose tool for that. The format itself should be very simple; the hard part - as in tedious - is making a GUI editor. Maybe the easiest solution is to simply load your image in an editor, and manually transcribe the coordinates? Yes this sounds crap but it will probably save you a lot of time overall unless you are doing this hundreds of times.