Had the same question as well but last answer was partially working for me, as i had other columns with both text and images and it was always parsing the image data.
But this actually worked out for me :
$.tablesorter.addParser({
id: 'img_alt',
is: function(s, table, cell) {
return false;
},
format: function(s, table, cell, cellIndex) {
var $cell = $(cell);
// in my case, img-alt data attribute should be parsed only for the 3rd column
if (cellIndex === 2) {
return $cell.find('img').attr('alt') || s;
} else
// just in case
return s;
},
type: 'text'
});