Hello,
This is nice code. But it is uncertain. I am trying with jpg to gif conversion. With some images it reduces the size and with some images it increase the size.
Can you help me that how can i get the reduced sized gif from jpg.
Thanks, ravi
Hello,
This is nice code. But it is uncertain. I am trying with jpg to gif conversion. With some images it reduces the size and with some images it increase the size.
Can you help me that how can i get the reduced sized gif from jpg.
Thanks, ravi
JPG and GIF are fundamentally different formats, and most images that compress well in the one won't in the other.
In very short and massively, massively simplified - JPG's main method of compression is removing and simplifying subtle nuances invisible (or almost invisible) to the human eye, thus reducing image size.
This method is especially useful for photographs because they usually contain a lot of such subtle nuances, and very little totally homogeneous areas.
GIF's main compression method is to reduce data by detecting streaks of identical colours, and compressing the information, so
red red red red red red red green green green red red red
becomes
7x red 3x green 3x red
this is known as Run Length Encoding.
obviously, this method is not suitable for photographs because usually, every pixel will have a slightly different colour value.
Therefore, photographic images can rarely be compressed well in GIF.
Why do you want to switch in the first place?