You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@commons.apache.org by Nikhil <ni...@gmail.com> on 2017/03/03 06:53:45 UTC

[imaging]

Hi,


1. Does Commons Imaging support changing dpi of an image ? E.g. Changing
1200x1200 image (jpeg / png) to 300x300.

     If yes, could you point me to a sample ?

2. Can Image be converted to grayscale 4 bit or 8 bit using the Imaging api
? If yes, could you point me to a sample ?


Thanks,

Nikhil

Re: [imaging]

Posted by Siegfried Goeschl <si...@it20one.com>.
Hi Nikhil,

some thoughts along the line

* In https://github.com/sgoeschl/java-image-processing-survival-guide/tree/master/code/jipsg you find code resizing/resampling of images with a lot of open source libraries
* The library being used depends on the range of source images - how many image formats, image sources, etc.
* Stay clear of TIFF if possible and PDF scans - will cause endless grief
* Personally I would use https://github.com/haraldk/TwelveMonkeys and Thumbnailator 

Thanks in advance,

Siegfried Goeschl

Disclaimer: I’m sort of affiliated with the “TwelveMonkeys” library since Harald Kuhr (the creator of the library) is a friend of mine and we did a couple of presentations together



> On 6 Mar 2017, at 04:52, Nikhil <ni...@gmail.com> wrote:
> 
> Thanks Siegfried. Your github details are really good. It gave a lot of
> details but also confused me to find the optimal production ready approach
> for the problem. Could you pls. guide me here ?
> 
> Here are the few usecases that I have,
> 1. Convert JPEG to PNG either color or grayscale depending upon the source
> image color. (I believe I need utility to find the source image color e.g.
> if image is already B/W , Grayscale or Color )
> 2. Update metadata and also resize the image to new dpi e.g. if source
> image is 1200x1200 then upon conversion to PNG it should be 300x300 dpi
> with same physical size.
> 
> What would be best library to use for above usecases ? (I believe java
> imageIO should be good enough for these tasks...correct ?)
> What should be the steps to do above two usecases ?
> 
> Thanks for your help. Appreciate it a lot !
> 
> Thanks,
> Nikhil
> 
> 
> On Sun, Mar 5, 2017 at 8:53 AM, Siegfried Goeschl <
> siegfried.goeschl@it20one.com> wrote:
> 
>> Hi Nikhil,
>> 
>> I do not know commons-image good enough to answer your questions but
>> 
>> * Do you mean changing the DPI value (metadata only) or resizing the image?
>> * While not related to Apache Commons Image the following link might help
>> - https://github.com/sgoeschl/java-image-processing-survival-guide <
>> https://github.com/sgoeschl/java-image-processing-survival-guide>
>> 
>> Thanks in advance,
>> 
>> Siegfried Goeschl
>> 
>> 
>>> On 3 Mar 2017, at 07:53, Nikhil <ni...@gmail.com> wrote:
>>> 
>>> Hi,
>>> 
>>> 
>>> 1. Does Commons Imaging support changing dpi of an image ? E.g. Changing
>>> 1200x1200 image (jpeg / png) to 300x300.
>>> 
>>>    If yes, could you point me to a sample ?
>>> 
>>> 2. Can Image be converted to grayscale 4 bit or 8 bit using the Imaging
>> api
>>> ? If yes, could you point me to a sample ?
>>> 
>>> 
>>> Thanks,
>>> 
>>> Nikhil
>> 
>> 


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
For additional commands, e-mail: user-help@commons.apache.org


Re: [imaging]

Posted by Nikhil <ni...@gmail.com>.
Thanks Siegfried. Your github details are really good. It gave a lot of
details but also confused me to find the optimal production ready approach
for the problem. Could you pls. guide me here ?

Here are the few usecases that I have,
1. Convert JPEG to PNG either color or grayscale depending upon the source
image color. (I believe I need utility to find the source image color e.g.
if image is already B/W , Grayscale or Color )
2. Update metadata and also resize the image to new dpi e.g. if source
image is 1200x1200 then upon conversion to PNG it should be 300x300 dpi
with same physical size.

What would be best library to use for above usecases ? (I believe java
imageIO should be good enough for these tasks...correct ?)
What should be the steps to do above two usecases ?

Thanks for your help. Appreciate it a lot !

Thanks,
Nikhil


On Sun, Mar 5, 2017 at 8:53 AM, Siegfried Goeschl <
siegfried.goeschl@it20one.com> wrote:

> Hi Nikhil,
>
> I do not know commons-image good enough to answer your questions but
>
> * Do you mean changing the DPI value (metadata only) or resizing the image?
> * While not related to Apache Commons Image the following link might help
> - https://github.com/sgoeschl/java-image-processing-survival-guide <
> https://github.com/sgoeschl/java-image-processing-survival-guide>
>
> Thanks in advance,
>
> Siegfried Goeschl
>
>
> > On 3 Mar 2017, at 07:53, Nikhil <ni...@gmail.com> wrote:
> >
> > Hi,
> >
> >
> > 1. Does Commons Imaging support changing dpi of an image ? E.g. Changing
> > 1200x1200 image (jpeg / png) to 300x300.
> >
> >     If yes, could you point me to a sample ?
> >
> > 2. Can Image be converted to grayscale 4 bit or 8 bit using the Imaging
> api
> > ? If yes, could you point me to a sample ?
> >
> >
> > Thanks,
> >
> > Nikhil
>
>

Re: [imaging]

Posted by Siegfried Goeschl <si...@it20one.com>.
Hi Nikhil,

I do not know commons-image good enough to answer your questions but 

* Do you mean changing the DPI value (metadata only) or resizing the image? 
* While not related to Apache Commons Image the following link might help - https://github.com/sgoeschl/java-image-processing-survival-guide <https://github.com/sgoeschl/java-image-processing-survival-guide>

Thanks in advance,

Siegfried Goeschl


> On 3 Mar 2017, at 07:53, Nikhil <ni...@gmail.com> wrote:
> 
> Hi,
> 
> 
> 1. Does Commons Imaging support changing dpi of an image ? E.g. Changing
> 1200x1200 image (jpeg / png) to 300x300.
> 
>     If yes, could you point me to a sample ?
> 
> 2. Can Image be converted to grayscale 4 bit or 8 bit using the Imaging api
> ? If yes, could you point me to a sample ?
> 
> 
> Thanks,
> 
> Nikhil