DiegoCatalano / Catalano-Framework

Framework
GNU Lesser General Public License v3.0
295 stars 99 forks source link

How can I increase the DPI of an image? #45

Closed ksmallik closed 5 years ago

ksmallik commented 7 years ago

Hi Folks, This is one of the most useful image processing libraries for Android. And what for bytes (lean and mean). Presently I need to increase the dpi(resolution) of an image. Should I use ResizeBicubic?

DiegoCatalano commented 7 years ago

Hello @ksmallik,

DPI is different than resolution. [Source]

DPI: Dot’s per inch. The number of dots in a printed inch. The more dot’s the higher the quality of the print (more sharpness and detail).

Resolution: Resolution is the measure of pixels in the display, usually expressed in measurements of width x height.

For increase the resolution, you can apply resize algorithms (Bicubic, Bilinear, Nearest Neighbor). Actually, in that library, the bicubic is the better.

For increase the DPI you can call the method: saveAsJPG(image, quality, xDpi, yDpi). This method only supports desktop, I'll port to android if you desire.

Look the image below, has the same resolution but with differents dpi.

image

ksmallik commented 7 years ago

Thanks for the reply @Diego. Thanks for the clarification. Yes, please port the method saveAsPNG() and saveAsXXX() methods. They would be very useful. When can we expect it?

ksmallik commented 7 years ago

@DiegoCatalano, can you atleast provide the java code for saveAsPNG() for Android. Need it for my app.

ksmallik commented 7 years ago

Thanks @DiegoCatalano. Just saw your added support function. How do I compile your code into a jar?

ksmallik commented 7 years ago

@DiegoCatalano I see that the DPI support is in Imaging Library(Have you ported to Android yet?).

DiegoCatalano commented 7 years ago

@ksmallik, I'm sorry, I was away solving a problem in the dissertation.

I'll port to android now

ksmallik commented 7 years ago

@DiegoCatalano Can you make it saveAsPNG()?

ksmallik commented 7 years ago

@DiegoCatalano I don't see the Android port? I understand that you have your dissertation, but please try to port the method today. Thanks.

ksmallik commented 7 years ago

@DiegoCatalano I will setttle for saveAsJPG(). Thanks.

ksmallik commented 7 years ago

Such a wonderful library and all I asked was one method to be added to it. I am very dissappointed @DiegoCatalano

ForThoseAboutToCode commented 7 years ago

@ksmallik

Diego has been doing excellent work with this library and I personally appreciate his work a lot!

Remember that developers rarely have the possibility to work all of his/her time on a single open source project. It is a bit naive to expect that requests (no matter how small or big) are immediately handled by the developer (or within days or even weeks). I bet Diego has some other duties in his life as well.

However, I'm sure he will implement your request (and all other requests in the pipeline) as soon as he can.

So, please, have patience and let the man do his work as he chooses.

ksmallik commented 7 years ago

@SakuKaukonen I apologize. As I mentioned in the first post, this is one of the rising frameworks. Maybe I expected him to provide a solution as soon as he said. I am new to asking for feature requests from the owner. Yes let him work at his pace and time.

DiegoCatalano commented 7 years ago

@ksmallik ,

I apologize a lot, this weekend including until yesterday I was not programming anything because I was traveling to hold some contests, I did not really have any time, but today I came back focused on helping you.

Today I will create the saveAsPNG () method, I promise.

DiegoCatalano commented 7 years ago

@ksmallik,

The saveAsJPG() and saveAsPNG() is ready, both support DPI in X and Y axis.

I'm sorry for the delay, until August I will be delaying to make new updates because I need to finish the master's degree.

Cheers !

ksmallik commented 7 years ago

You rock @DiegoCatalano!!