A jar (and war and ear) are .zip archives that have a specific directory and file structure under them.
As they are zipped, the only way to further compress the contents is to remove things from them. This may be in the form of deduplication (I once dealt with deployment that had duplicates for the classes and the client that were packaged in the same deployment - though admittedly that was deployed in an exploded structure) or it may be in moving the resources to other services.
Images tend to be already compressed and thus themselves compress poorly in a compressed archive (such as a .jar). If the images are making the .jar too large, you need to remove them or replace them with smaller images (change the complexity of the image to something that compresses better).
In the case of "I wanted to reduce jar file size because I have to upload it in a portal for my college project" your recourse is probably to talk to the people giving you the assignment. If you can't make the images smaller or remove them from the .jar, you can't make the .jar smaller.