Internet of Things (IoT) is becoming more popular with the increase in advancements of technology and is widely used in various sectors. The data are collected from the real environment and then transmitted over the networks. Due to their restricted resources, processing capacity, and memory, IoT gadgets are susceptible to certain security risks. Several encryption methodologies were established to provide safe communication between IoT devices with minimal computing cost and bandwidth consumption, due to the rise in media date. This research proposes a revolutionary compact pixel crypto (CPC) technique that can accommodate the modest transmission speeds of IoT gadgets. The suggested techniques reduces the computational burden and data quantity by encrypting the image data using pixel driven selective encryption and bloke scanning compression. The suggested method’s effectiveness is examined using the network simulator (NS-2) platform. According to the findings of the experiments, the suggested method outperforms the previous approaches in terms of both packet rate and energy usage. The proposed approach shortens the time needed for node side encryption and decryption operations with improving the system’s energy effectiveness and connectivity performance.