I think writing a custom importer is going to be a huge pain since it’s not just reading in pixels but 32x32 or even 64x64 cells, and figuring out duplicates in JavaScript is likely not going to be very efficient.
Indeed this is a feature that still hasn’t made it, but in the meantime there are some alternatives you could try to turn your image into a Tiled map + tileset, some of which I’ve mentioned here:
That said, it really should be as easy as choosing “Open Image as Map” from the File menu, choosing the tile size, and done.