Small jpg manipulation library? - Embedded

This is a discussion on Small jpg manipulation library? - Embedded ; I have a simple request: I need a small proggie that will let me rotate a 640x480 jpeg image 180 degrees, and add a short piece of text (about 2 lines, maybe 25 chars each) to the image itself. My ...

+ Reply to Thread
Results 1 to 10 of 10

Thread: Small jpg manipulation library?

  1. Small jpg manipulation library?

    I have a simple request:

    I need a small proggie that will let me rotate a 640x480 jpeg image 180
    degrees, and add a short piece of text (about 2 lines, maybe 25 chars
    each) to the image itself.

    My embedded sytem only has about 500K of flash left, so I really need
    something that fits in that space.

    I can create the image as raw RGB, do the manipulations, and then save it
    as a jpeg if that would help.

    I would appreciate any pointers....

    Thanks,

    --Yan

    --
    o__
    ,>/'_ o__
    (_)\(_) ,>/'_ o__
    Yan Seiner, PE (_)\(_) ,>/'_ o__
    Certified Personal Trainer (_)\(_) ,>/'_ o__
    Licensed Professional Engineer (_)\(_) ,>/'_
    Who says engineers have to be pencil necked geeks? (_)\(_)


  2. Re: Small jpg manipulation library?


    Captain Dondo wrote:
    > I have a simple request:
    >
    > I need a small proggie that will let me rotate a 640x480 jpeg image 180
    > degrees, and add a short piece of text (about 2 lines, maybe 25 chars
    > each) to the image itself.
    >
    > My embedded sytem only has about 500K of flash left, so I really need
    > something that fits in that space.


    How much RAM you got? You need to store two fully decompressed images
    at least.

    >
    > I can create the image as raw RGB, do the manipulations, and then save it
    > as a jpeg if that would help.
    >
    > I would appreciate any pointers....
    >
    > Thanks,
    >
    > --Yan
    >
    > --
    > o__
    > ,>/'_ o__
    > (_)\(_) ,>/'_ o__
    > Yan Seiner, PE (_)\(_) ,>/'_ o__
    > Certified Personal Trainer (_)\(_) ,>/'_ o__
    > Licensed Professional Engineer (_)\(_) ,>/'_
    > Who says engineers have to be pencil necked geeks? (_)\(_)



  3. Re: Small jpg manipulation library?

    On Sun, 18 Jun 2006 12:18:27 -0700, linnix wrote:

    >
    > Captain Dondo wrote:
    >> I have a simple request:
    >>
    >> I need a small proggie that will let me rotate a 640x480 jpeg image 180
    >> degrees, and add a short piece of text (about 2 lines, maybe 25 chars
    >> each) to the image itself.
    >>
    >> My embedded sytem only has about 500K of flash left, so I really need
    >> something that fits in that space.

    >
    > How much RAM you got? You need to store two fully decompressed images
    > at least.


    The images should only take up ~1MB uncompressed; I have 32 MB total and
    15-16MB free:

    root@apollo:/bin# free
    total used free shared buffers
    Mem: 30556 15368 15188 0 1520

    So RAM shouldn't be an issue. I figured out I can do the jpeg rotation
    with jpegtran; now I just need to find something I can use to add a
    watermark....

    --Yan

    --
    o__
    ,>/'_ o__
    (_)\(_) ,>/'_ o__
    Yan Seiner, PE (_)\(_) ,>/'_ o__
    Certified Personal Trainer (_)\(_) ,>/'_ o__
    Licensed Professional Engineer (_)\(_) ,>/'_
    Who says engineers have to be pencil necked geeks? (_)\(_)


  4. Re: Small jpg manipulation library?


    Captain Dondo wrote:
    > On Sun, 18 Jun 2006 12:18:27 -0700, linnix wrote:
    >
    > >
    > > Captain Dondo wrote:
    > >> I have a simple request:
    > >>
    > >> I need a small proggie that will let me rotate a 640x480 jpeg image 180
    > >> degrees, and add a short piece of text (about 2 lines, maybe 25 chars
    > >> each) to the image itself.
    > >>
    > >> My embedded sytem only has about 500K of flash left, so I really need
    > >> something that fits in that space.

    > >
    > > How much RAM you got? You need to store two fully decompressed images
    > > at least.

    >
    > The images should only take up ~1MB uncompressed; I have 32 MB total and
    > 15-16MB free:
    >
    > root@apollo:/bin# free
    > total used free shared buffers
    > Mem: 30556 15368 15188 0 1520
    >
    > So RAM shouldn't be an issue. I figured out I can do the jpeg rotation
    > with jpegtran; now I just need to find something I can use to add a
    > watermark....


    Is the text static? We have a program to overlay one image on another,
    If you first create the text overlay image elsewhere. You can just
    screen capture from a word processor. Is your target x86, arm or what?

    >
    > --Yan
    >
    > --
    > o__
    > ,>/'_ o__
    > (_)\(_) ,>/'_ o__
    > Yan Seiner, PE (_)\(_) ,>/'_ o__
    > Certified Personal Trainer (_)\(_) ,>/'_ o__
    > Licensed Professional Engineer (_)\(_) ,>/'_
    > Who says engineers have to be pencil necked geeks? (_)\(_)



  5. Re: Small jpg manipulation library?

    On Sun, 18 Jun 2006 13:29:42 -0700, linnix wrote:

    >
    > Is the text static? We have a program to overlay one image on another,
    > If you first create the text overlay image elsewhere. You can just
    > screen capture from a word processor. Is your target x86, arm or what?
    >


    No, the text is dynamic. It is generated on the fly from GPS data and a
    database lookup.

    I am trying to avoid using a lot of resources with font-rendering stuff; I
    really just want a stamp much like the date and time stamp you can put on
    digital photographs taken with a regular camera.

    --Yan

  6. Re: Small jpg manipulation library?


    Captain Dondo wrote:
    > On Sun, 18 Jun 2006 13:29:42 -0700, linnix wrote:
    >
    > >
    > > Is the text static? We have a program to overlay one image on another,
    > > If you first create the text overlay image elsewhere. You can just
    > > screen capture from a word processor. Is your target x86, arm or what?
    > >

    >
    > No, the text is dynamic. It is generated on the fly from GPS data and a
    > database lookup.
    >
    > I am trying to avoid using a lot of resources with font-rendering stuff; I
    > really just want a stamp much like the date and time stamp you can put on
    > digital photographs taken with a regular camera.
    >
    > --Yan


    OK, if you provide the character images (one jpg per character), we can
    give you a tool to overlay it on an image. We have a program:

    jpg -i old.jpg -c blue -m mask.jpg -o new.jpg

    Will work on:
    new_program -x 100 -y 100 -i old.jpg-o mask.jpg -t text

    What is your target cpu?


  7. Re: Small jpg manipulation library?

    On Sun, 18 Jun 2006 13:55:41 -0700, linnix wrote:

    >
    > Captain Dondo wrote:
    >> On Sun, 18 Jun 2006 13:29:42 -0700, linnix wrote:
    >>
    >> >
    >> > Is the text static? We have a program to overlay one image on another,
    >> > If you first create the text overlay image elsewhere. You can just
    >> > screen capture from a word processor. Is your target x86, arm or what?
    >> >

    >>
    >> No, the text is dynamic. It is generated on the fly from GPS data and a
    >> database lookup.
    >>
    >> I am trying to avoid using a lot of resources with font-rendering stuff; I
    >> really just want a stamp much like the date and time stamp you can put on
    >> digital photographs taken with a regular camera.
    >>
    >> --Yan

    >
    > OK, if you provide the character images (one jpg per character), we can
    > give you a tool to overlay it on an image. We have a program:
    >
    > jpg -i old.jpg -c blue -m mask.jpg -o new.jpg
    >
    > Will work on:
    > new_program -x 100 -y 100 -i old.jpg-o mask.jpg -t text
    >
    > What is your target cpu?


    mips. This is for an app running on OpenWrt - a Linksys WRTSL54GL
    wireless router, with a webcam and a GPS attached.

    --Yan

    --
    o__
    ,>/'_ o__
    (_)\(_) ,>/'_ o__
    Yan Seiner, PE (_)\(_) ,>/'_ o__
    Certified Personal Trainer (_)\(_) ,>/'_ o__
    Licensed Professional Engineer (_)\(_) ,>/'_
    Who says engineers have to be pencil necked geeks? (_)\(_)


  8. Re: Small jpg manipulation library?


    Captain Dondo wrote:
    > On Sun, 18 Jun 2006 13:55:41 -0700, linnix wrote:
    >
    > >
    > > Captain Dondo wrote:
    > >> On Sun, 18 Jun 2006 13:29:42 -0700, linnix wrote:
    > >>
    > >> >
    > >> > Is the text static? We have a program to overlay one image on another,
    > >> > If you first create the text overlay image elsewhere. You can just
    > >> > screen capture from a word processor. Is your target x86, arm or what?
    > >> >
    > >>
    > >> No, the text is dynamic. It is generated on the fly from GPS data and a
    > >> database lookup.
    > >>
    > >> I am trying to avoid using a lot of resources with font-rendering stuff; I
    > >> really just want a stamp much like the date and time stamp you can put on
    > >> digital photographs taken with a regular camera.
    > >>
    > >> --Yan

    > >
    > > OK, if you provide the character images (one jpg per character), we can
    > > give you a tool to overlay it on an image. We have a program:
    > >
    > > jpg -i old.jpg -c blue -m mask.jpg -o new.jpg
    > >
    > > Will work on:
    > > new_program -x 100 -y 100 -i old.jpg-o mask.jpg -t text
    > >
    > > What is your target cpu?

    >
    > mips. This is for an app running on OpenWrt - a Linksys WRTSL54GL
    > wireless router, with a webcam and a GPS attached.


    OK, we can deal with mips later. We also want to have text overlays.
    We need character bit maps for letters and symbols, We already have
    numbers. They should be like:

    "* * ",
    "* * * * ",
    "* * * * ",
    "* * * * ",
    "* ** * ",
    "* * ",
    "* * ",
    "* * ",
    "* * ",
    "* * "

    This is just a on-time program to generate the intermediate structure,
    so don't worry about efficience.

    If you can help, I'll set you up with an account on our server. Do you
    want to do it?

    >
    > --Yan
    >
    > --
    > o__
    > ,>/'_ o__
    > (_)\(_) ,>/'_ o__
    > Yan Seiner, PE (_)\(_) ,>/'_ o__
    > Certified Personal Trainer (_)\(_) ,>/'_ o__
    > Licensed Professional Engineer (_)\(_) ,>/'_
    > Who says engineers have to be pencil necked geeks? (_)\(_)



  9. Re: Small jpg manipulation library?

    On Sun, 18 Jun 2006 14:24:05 -0700, linnix wrote:

    >
    > Captain Dondo wrote:
    >> On Sun, 18 Jun 2006 13:55:41 -0700, linnix wrote:
    >>
    >> >
    >> > Captain Dondo wrote:
    >> >> On Sun, 18 Jun 2006 13:29:42 -0700, linnix wrote:
    >> >>
    >> >> >
    >> >> > Is the text static? We have a program to overlay one image on another,
    >> >> > If you first create the text overlay image elsewhere. You can just
    >> >> > screen capture from a word processor. Is your target x86, arm or what?
    >> >> >
    >> >>
    >> >> No, the text is dynamic. It is generated on the fly from GPS data and a
    >> >> database lookup.
    >> >>
    >> >> I am trying to avoid using a lot of resources with font-rendering stuff; I
    >> >> really just want a stamp much like the date and time stamp you can put on
    >> >> digital photographs taken with a regular camera.
    >> >>
    >> >> --Yan
    >> >
    >> > OK, if you provide the character images (one jpg per character), we can
    >> > give you a tool to overlay it on an image. We have a program:
    >> >
    >> > jpg -i old.jpg -c blue -m mask.jpg -o new.jpg
    >> >
    >> > Will work on:
    >> > new_program -x 100 -y 100 -i old.jpg-o mask.jpg -t text
    >> >
    >> > What is your target cpu?

    >>
    >> mips. This is for an app running on OpenWrt - a Linksys WRTSL54GL
    >> wireless router, with a webcam and a GPS attached.

    >
    > OK, we can deal with mips later. We also want to have text overlays.
    > We need character bit maps for letters and symbols, We already have
    > numbers. They should be like:
    >
    > "* * ",
    > "* * * * ",
    > "* * * * ",
    > "* * * * ",
    > "* ** * ",
    > "* * ",
    > "* * ",
    > "* * ",
    > "* * ",
    > "* * "
    >
    > This is just a on-time program to generate the intermediate structure,
    > so don't worry about efficience.


    Why reinvent the wheel? http://www.kevinboone.com/README_txt2jpg.html

    It's java, but with this being a one-off, it doesn't really matter.

    >
    > If you can help, I'll set you up with an account on our server. Do you
    > want to do it?


    I can help some. Remove the obvious from my email address to contact me
    directly. I'm going out of town today, and when I return I may have to go
    on yet another business trip (overseas, yet) so my time for the next 3-4
    weeks is severly limited, though.

    --Yan

    --
    o__
    ,>/'_ o__
    (_)\(_) ,>/'_ o__
    Yan Seiner, PE (_)\(_) ,>/'_ o__
    Certified Personal Trainer (_)\(_) ,>/'_ o__
    Licensed Professional Engineer (_)\(_) ,>/'_
    Who says engineers have to be pencil necked geeks? (_)\(_)


  10. Re: Small jpg manipulation library?


    > Why reinvent the wheel? http://www.kevinboone.com/README_txt2jpg.html
    >
    > It's java, but with this being a one-off, it doesn't really matter.
    >


    Java (jpeg Jre) is heavy. It's much easier to strip down jpeg lib.
    We have about 150K binary so far. The following is an example
    (for our dance teacher) for jpg resolution reductions. We want to
    overlay both texts and images on it as well.

    http://rumba.fine-arts.ws

    -rw-r--r-- 1 root wheel 133 Jun 19 19:00 Makefile
    -rw-r--r-- 1 root wheel 38603 Jun 19 19:02 a1.jpg
    -rw-r--r-- 1 root wheel 24366 Jun 19 19:02 a2.jpg
    -rw-r--r-- 1 root wheel 14051 Jun 19 19:05 b1.jpg
    -rw-r--r-- 1 root wheel 14510 Jun 19 19:05 b2.jpg
    -rw-r--r-- 1 root wheel 5353 Jun 19 19:05 c1.jpg
    -rw-r--r-- 1 root wheel 5491 Jun 19 19:05 c2.jpg
    -rw-r--r-- 1 root wheel 38 Jun 19 19:00 data
    -rw-r--r-- 1 root wheel 604 Jun 19 19:06 index.html
    -rwxr-xr-x 1 root wheel 124878 Jun 19 18:55 jpg
    -rwxr-xr-x 1 root wheel 2635 Jun 19 19:29 main.php
    -bash-2.05b# more Makefile
    all:
    ./jpg -i a1.jpg -o b1.jpg -r 2
    ./jpg -i a2.jpg -o b2.jpg -r 2
    ./jpg -i b1.jpg -o c1.jpg -r 2
    ./jpg -i b2.jpg -o c2.jpg -r 2


+ Reply to Thread