Just out of curiosity, I came up with a proof-of-concept script for PS to do what you suggested, but unfortunately it is extremely slow. If you want to test it, make a new document around 25px square, name the base layer "base" and then add two empty layers named "Alpha" and "HSB". The alpha layer gets filled with pixels that have a grey value (in RGB) based upon the S value, and the HSB layer gets filled with pixels which have the S value modified to 100. The Alpha layer can be used as a layer mask for the HSB layer (select all, add layer mask to HSB layer, switch to channels and paste the copied alpha layer into the HSB mask channel).
If you hide all palettes, it appears to run slightly faster, but a real image is "go get coffee and maybe do a little shopping" slow. "Take a nap" slow.
var currDoc = app.activeDocument;
var sampler = currDoc.colorSamplers.add([0,0]);
for (var x = 0; x < currDoc.width; ++x) {
for (var y = 0; y < currDoc.height; ++y) {
currDoc.activeLayer = currDoc.artLayers.getByName("base");
sampler.move([x,y]);
var result = selectPixel(x,y, currDoc);
result = setPixelColorHSB(sampler.color, currDoc);
result = setPixelColorALPHA(sampler.color, currDoc);
}
}
sampler = null;
currDoc.selection.deselect;
function setPixelColorHSB(pixelColor, currDoc) {
currDoc.activeLayer = currDoc.artLayers.getByName("HSB");
currDoc.activeLayer.visible = true;
var color = new SolidColor();
color.hsb.hue = pixelColor.hsb.hue;
color.hsb.saturation = 100;
color.hsb.brightness=pixelColor.hsb.brightness;
currDoc.selection.fill(color);
currDoc.activeLayer.visible = false;
return true;
}
function setPixelColorALPHA(pixelColor, currDoc) {
currDoc.activeLayer = currDoc.artLayers.getByName("ALPHA");
currDoc.activeLayer.visible = true;
var color = new SolidColor();
color.rgb.red = Math.floor((pixelColor.hsb.saturation/100) * 255);
color.rgb.green = color.rgb.red;
color.rgb.blue = color.rgb.red;
currDoc.selection.fill(color);
currDoc.activeLayer.visible = false;
return true;
}
function selectPixel (pixX, pixY, currDoc) {
currDoc.selection.deselect;
var selRegion = null;
selRegion = [
[pixX, pixY],
[pixX + 1, pixY],
[pixX + 1, pixY + 1],
[pixX, pixY + 1],
[pixX, pixY]
];
currDoc.selection.select(selRegion);
return true;
}