The transmitted information on the internet are prone to security concerns. To overcome this issue, some security methods have been developed in the last few decades. One of the reliable techniques to secure data is called data hiding. This method can be used in various multimedia data, like image, video, text, and audio. Histogram shifting (HS) is a reliable data hiding method used in digital images. It can preserve the similarity of the stego and original image; although, the amount of the protected data depends on the frequency of the most amount pixel in the original image. To solve this problem, we combine HS with prediction error (PE). By using the histogram generated by PE, the size of data that can be embedded increases. In the embedding phase, we do not shift the histogram, different from the existing methods. It is to maintain its original form as high as possible. Moreover, each PE value can contain more data. Based on the experimental result, the average increase in PSNR is 24.8075 dB for general images and 21.5625dB for medical images; while the average improvement of SSIM is 0.026823 and 0.022863 for general and medical images, respectively.