Do you have a question? Post it now! No Registration Necessary
- Captain Dondo
June 18, 2006, 4:28 pm

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
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__
,>/'_ o__
We've slightly trimmed the long signature. Click to see the full one.

Re: Small jpg manipulation library?

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__
,>/'_ o__
We've slightly trimmed the long signature. Click to see the full one.

Re: Small jpg manipulation library?

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

Re: Small jpg manipulation library?

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?

Re: Small jpg manipulation library?

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?


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.

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__
,>/'_ o__
We've slightly trimmed the long signature. Click to see the full one.

Re: Small jpg manipulation library?

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
Site Timeline
- » Periodic Timer for 1 millisecond timer in linux kernel mode
- — Next thread in » Embedded Linux
-
- » Linux 2.6 - Bestcomm - MPC5200B - External module
- — Previous thread in » Embedded Linux
-
- » Crosscompiling for ARM: reloc type R_ARM_ABS32 is not supported for PIC - ...
- — Newest thread in » Embedded Linux
-
- » British Medical Journal: Pfizer Vaccine Efficacy 52% After First Dose
- — The site's Newest Thread. Posted in » Electronics Design
-
- » Rules
- — The site's Last Updated Thread. Posted in » Microcontrollers (Russian)
-