Analyzing each constituent task involved in wireless sensor network image compression and communication processes revealed a considerable difference in energy consumption rates among these tasks, shortening the network lifetime, which is defined as the time interval to the death of the first sensor node. To overcome this problem, we proposed an adaptive transmission range assignment algorithm for in-routing image compression (ARIC) for wireless sensor networks. ARIC uses collaborative image compression to distribute the computational cost among the sensor nodes involved in routing paths between source nodes and base stations. The energy distribution involved in ARIC is formulated here as a mathematical optimization problem that can be mapped to a 0-1 Multiple Choice Knapsack Problem (0-1 MCKP); we then present a dynamic programming method to solve for the optimization solution. This method allows the source sensor nodes to dynamically assign compression and com munication tasks to appropriate sensor nodes according to their residual energy. To verify ARIC's efficacy, we then conducted computational experiments on the optimization problem; these show that ARIC effectively balances the total energy consumption among sensor nodes thereby increasing the overall network lifetime.