This paper proposes a method for estimating the quantitative values of some attributes associated with surface qualities of an object, such as glossiness and transparency, from its image. Our approach is to learn functions that compute such attribute values from the input image by using training data given in the form of relative information. To be specific, each sample of the training data represents that, for a pair of images, which is greater in terms of the target attribute. The functions are learned based on leaning to rank. This approach enables us to deal with natural images, which cannot be dealt with in previous works, which are based on CG synthesized images for both training and testing. We created data sets using the Flickr Material Database for four attributes of glossiness, transparency, smoothness, and coldness, and learn the functions representing the values of these attributes. We present experimental results that the learned functions show very promising performances in the estimation of the attribute values.