Is there a way to pad or “decompress” an image (JPEG) in bash? By this I mean, if the image size is 1.5MB I want it padded up to 5MB, for example. The resultant quality of the image is not (so) important. And if this padding leaves a black rectangle by the side of the image it is acceptable.
EDIT:
THe sole answer below guessed correctly that it was an XY problem.
A quick experiment indicates that just appending zero bytes to a
*.jpgimage file still allows it to be viewed.On Unix, I used a command like this:
I suspect that any arbitrary data, not just zeros, would have the same result.
(Using an image editor to append a black rectangle to an image probably wouldn’t increase the file size by much; compression works really well on blocks of solid color.)
I can hardly imagine a good reason to do this, though.
Update :
Based on your comment, this answers the question you asked, but almost certainly won’t address your actual problem. You haven’t given us enough information to guess how to do that.
This is a classic XY problem.