High Quality Content by WIKIPEDIA articles! In geology and oceanography, diagenesis is any chemical, physical, or biological change undergone by a sediment after its initial deposition and during and after its lithification, exclusive of surface alteration (weathering) and metamorphism. These changes happen at relatively low temperatures and pressures and result in changes to the rock's original mineralogy and texture. The boundary between diagenesis and metamorphism, which occurs under conditions of higher temperature and pressure, is gradational. After deposition, sediments are compacted as they are buried beneath successive layers of sediment and cemented by minerals that precipitate from solution. Grains of sediment, rock fragments and fossils can be replaced by other minerals during diagenesis. Porosity usually decreases during diagenesis, except in rare cases such as dissolution of minerals and dolomitization. The study of diagenesis in rocks is used to understand the tectonic history they have undergone; the nature and type of fluids that have circulated through them.