It has been demonstrated experimentally that Leverett's J-function yields almost unique dimensionless drainage capillary pressure eurves in relatively homogeneous rocks at strongly water-wet conditions, whereas for imbibition at mixed-wet conditions, it docs not work satisfactorily because the permeability dependency on capillary pressure has been reported to be weak. The purpose of this study is to formulate a new dimensionless capillary pressure function for mixed-wet conditions on the basis of pore-scale modeling, which eould overcome these restrictions. Wc simulate drainage, wettability alteration, and imbibition in 2D roek images by use of a scmianalytical pore-scale model that represents the identified pore spaces as cross sections of straight eapillary tubes. The fluid configurations oceurring during drainage and imbibition in the highly irregular pore spaces are modeled at any eapillary pressure and wetting condition by eombining the free-energy minimization with an are meniscus (AM) determining procedure that identifies the intersections of two circles moving in opposite directions along the pore boundary. Circle rotation at pinned contact lines accounts for mixed-wet conditions. Capillary pressure curves for imbibition are simulated for different mixed-wet conditions in Bentheim sandstone samples, and the results are scaled by a newly proposed improved J -function that accounts for differences in formation wettability induced by different initial water saturations after primary drainage. At the end of primary drainage, oil-wct-pore wall segments are connected by many water-wet corners and constrictions that remain occupied by water. The novel dimensionless capillary pressure expression accounts for these conditions by introducing an effective contact angle that depends on the initial water saturation and is related to the wetting prop-erty measured at the core scale by means of a wettability index. The accuracy of the proposed J-function is tested on 36 imbibition capillary pressure curves for different mixed-wet conditions that are simulated with the scmianalytical model in scanning-elcc- tron-microscope (SEM) images of Bentheim sandstone. The simulated imbibition capillary pressure curves and the reproduced curves, based on the proposed J-function, are in good agreement for the mixed-wet conditions considered in this study. The detailed behavior is explained by analyzing the fluid displacements occur-ring in the pore spaces. It is demonstrated that the proposed J-function could be applied to mixed-wet conditions to generate a family of curves describing different wetting states induced by assigning different wetting properties on the solid surfaces or by varying the initial water saturation after primary drainage. The variability of formation wettability and permeability could be described more accurately in reservoir-simulation models by means of the proposed J-function, and hence the opportunity arises for improved evaluation of core-sample laboratory experiments and reservoir performance.