Regarding photoshop part, IIRC by default photoshop's gradient isn't exactly linear, it adds some curve to it called "smoothing" or something like that, so you may want to remove it first. I can't tell you where to find it exactly, since i don't use photoshop anymore.
By the way, did you try Bercon tiles and Bercon gradient? They are perfect tools for such procedural bricks.