Context-based lossless image compression schemes use 180° type modeling contexts in one pass scanning an image. In this paper, a lossless image compression (LIC) scheme is introduced and for capturing high-order dependencies, statistical features and spatial configuration of an image, threepass scheme with 360° type modeling contexts is proposed. Linear and nonlinear relationships between pixels in a context are used for context determination. Also the three-pass algorithm is applied to JPEG-LS standard, and for context determination, local gradients of intensity capturing the level of activity (smoothness, edginess) surrounding a pixel, is employed. For images with small dimensions three-pass schemes and for large dimensions one-pass schemes result in higher compression ratios.