Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Readers > Amazon Kindle > Kindle Developer's Corner

Notices

Reply
 
Thread Tools Search this Thread
Old 08-06-2016, 10:24 AM   #1
nasser
Evangelist
nasser ought to be getting tired of karma fortunes by now.nasser ought to be getting tired of karma fortunes by now.nasser ought to be getting tired of karma fortunes by now.nasser ought to be getting tired of karma fortunes by now.nasser ought to be getting tired of karma fortunes by now.nasser ought to be getting tired of karma fortunes by now.nasser ought to be getting tired of karma fortunes by now.nasser ought to be getting tired of karma fortunes by now.nasser ought to be getting tired of karma fortunes by now.nasser ought to be getting tired of karma fortunes by now.nasser ought to be getting tired of karma fortunes by now.
 
nasser's Avatar
 
Posts: 475
Karma: 445678
Join Date: Feb 2010
Device: Too many..
Using built-in imagemagick to crop an image

How do I use the built-in imagemagick application to crop an existing image in .png format?

- the image is generated by the "press opposite corners" screenshot trick.
- I use pw1 and pw3. So the images would be 758x1024 and 1072x1440.
- I assume the IM command can be entered from kterm and could be converted into a KUAL extension.. since the crop size and location I want is fixed
- I want to generate a screenshot from the Eboard Chess application and do a crop so that I get an image of the board only.
nasser is offline   Reply With Quote
Old 08-06-2016, 10:37 AM   #2
knc1
Going Viral
knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.
 
knc1's Avatar
 
Posts: 17,212
Karma: 18210809
Join Date: Feb 2012
Location: Central Texas
Device: No K1, PW2, KV, KOA
Code:
man imagemagick
Either on a full *nix installation (one with the man(ual)s intalled) or in your web search engine.
knc1 is offline   Reply With Quote
Advert
Old 08-06-2016, 01:45 PM   #3
nasser
Evangelist
nasser ought to be getting tired of karma fortunes by now.nasser ought to be getting tired of karma fortunes by now.nasser ought to be getting tired of karma fortunes by now.nasser ought to be getting tired of karma fortunes by now.nasser ought to be getting tired of karma fortunes by now.nasser ought to be getting tired of karma fortunes by now.nasser ought to be getting tired of karma fortunes by now.nasser ought to be getting tired of karma fortunes by now.nasser ought to be getting tired of karma fortunes by now.nasser ought to be getting tired of karma fortunes by now.nasser ought to be getting tired of karma fortunes by now.
 
nasser's Avatar
 
Posts: 475
Karma: 445678
Join Date: Feb 2010
Device: Too many..
Hmm... I was asking about using imagemagick ON the Kindles..
I read here somewhere that the screensavers hack uses it.
nasser is offline   Reply With Quote
Old 08-06-2016, 02:08 PM   #4
knc1
Going Viral
knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.
 
knc1's Avatar
 
Posts: 17,212
Karma: 18210809
Join Date: Feb 2012
Location: Central Texas
Device: No K1, PW2, KV, KOA
Quote:
Originally Posted by nasser View Post
Hmm... I was asking about using imagemagick ON the Kindles..
I read here somewhere that the screensavers hack uses it.
It is only the man command that does not work on the Kindle.
I.E:
The Linux (a *nix system type) is not a full installation, it is only a partial, embedded system.
So you need to have access to either a complete install of a *nix based system or access to a web search engine (both will recognize the manual command I listed for you).

IM is not pre-installed that I know of, it is part of the ss package.
knc1 is offline   Reply With Quote
Old 08-06-2016, 03:13 PM   #5
Yourcat
Groupie
Yourcat knows the way to San Jose.Yourcat knows the way to San Jose.Yourcat knows the way to San Jose.Yourcat knows the way to San Jose.Yourcat knows the way to San Jose.Yourcat knows the way to San Jose.Yourcat knows the way to San Jose.Yourcat knows the way to San Jose.Yourcat knows the way to San Jose.Yourcat knows the way to San Jose.Yourcat knows the way to San Jose.
 
Posts: 175
Karma: 54048
Join Date: Mar 2016
Device: PW3 5.6.5-usbnet
IM should support the basic features, also on Kindle. Did you try 'convert -crop ...' already?
Yourcat is offline   Reply With Quote
Advert
Old 08-06-2016, 10:00 PM   #6
nasser
Evangelist
nasser ought to be getting tired of karma fortunes by now.nasser ought to be getting tired of karma fortunes by now.nasser ought to be getting tired of karma fortunes by now.nasser ought to be getting tired of karma fortunes by now.nasser ought to be getting tired of karma fortunes by now.nasser ought to be getting tired of karma fortunes by now.nasser ought to be getting tired of karma fortunes by now.nasser ought to be getting tired of karma fortunes by now.nasser ought to be getting tired of karma fortunes by now.nasser ought to be getting tired of karma fortunes by now.nasser ought to be getting tired of karma fortunes by now.
 
nasser's Avatar
 
Posts: 475
Karma: 445678
Join Date: Feb 2010
Device: Too many..
I tried convert command without any arguments on my pw3 and I got a help list. But on my pw1 I got a 'command not found' message. How come? I have installed the screensaver hack on my pw1. Isn't it supposed to be using IM?
nasser is offline   Reply With Quote
Old 08-06-2016, 10:03 PM   #7
knc1
Going Viral
knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.
 
knc1's Avatar
 
Posts: 17,212
Karma: 18210809
Join Date: Feb 2012
Location: Central Texas
Device: No K1, PW2, KV, KOA
Start checking with the most basic possiblities -
Is the PATH variable the same on both devices?
On the one that is found, where is it?
Check the same path on the one that is not found, is it really not there?
knc1 is offline   Reply With Quote
Old 08-07-2016, 12:24 AM   #8
nasser
Evangelist
nasser ought to be getting tired of karma fortunes by now.nasser ought to be getting tired of karma fortunes by now.nasser ought to be getting tired of karma fortunes by now.nasser ought to be getting tired of karma fortunes by now.nasser ought to be getting tired of karma fortunes by now.nasser ought to be getting tired of karma fortunes by now.nasser ought to be getting tired of karma fortunes by now.nasser ought to be getting tired of karma fortunes by now.nasser ought to be getting tired of karma fortunes by now.nasser ought to be getting tired of karma fortunes by now.nasser ought to be getting tired of karma fortunes by now.
 
nasser's Avatar
 
Posts: 475
Karma: 445678
Join Date: Feb 2010
Device: Too many..
Thanks, knc1!
I already checked.

On both the pw1 and pw3, there is a "convert" executable in the '/mnt/us/linkss/bin' folder. However this executable is not in the PATH variable.

On the pw3, there is an additional "convert" executable in the '/usr/local/bin' folder - which is in the path variable.

So, that clears up the mystery!

Also, '/usr/local/bin' of the pw3 contains lots of other stuff. These are the goodies you mentioned would be available in the "factory" image, which gets stripped out in the "customer" image, like in my pw1 - which only contains "usbnetwork.sh".

You had also mentioned the possibility of transferring these goodies over to a "customer" image kindle. Would a plain copy work?

Ok. Let me play with 'convert' now..
nasser is offline   Reply With Quote
Old 08-07-2016, 02:36 AM   #9
knc1
Going Viral
knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.
 
knc1's Avatar
 
Posts: 17,212
Karma: 18210809
Join Date: Feb 2012
Location: Central Texas
Device: No K1, PW2, KV, KOA
Better to make an archive of it and copy the archive:
Code:
cd /usr
tar -czf /mnt/us/factutil.tgz local
Then move the archive from the top level of visible USB storage to top level of visible USB storage on the other device.
Code:
cd /usr
tar -xzf /mnt/us/factutil.tgz
That way ownerships and permissions are preserved, which would not be if you just copied the files to FAT-32 and then back again.
knc1 is offline   Reply With Quote
Old 08-07-2016, 06:59 AM   #10
nasser
Evangelist
nasser ought to be getting tired of karma fortunes by now.nasser ought to be getting tired of karma fortunes by now.nasser ought to be getting tired of karma fortunes by now.nasser ought to be getting tired of karma fortunes by now.nasser ought to be getting tired of karma fortunes by now.nasser ought to be getting tired of karma fortunes by now.nasser ought to be getting tired of karma fortunes by now.nasser ought to be getting tired of karma fortunes by now.nasser ought to be getting tired of karma fortunes by now.nasser ought to be getting tired of karma fortunes by now.nasser ought to be getting tired of karma fortunes by now.
 
nasser's Avatar
 
Posts: 475
Karma: 445678
Join Date: Feb 2010
Device: Too many..
Success!
Got what I wanted..

Steps:
  1. Install screensavers hack, if not already installed.
  2. In Eboard Chess settings, untick the "Show Coordinates" option.
  3. Play through a game, or set up a position using the scratch board option.
  4. Touch opposite corners to capture the screen image. This will be saved in /mnt/us as "screenshot_2016..png".
  5. Make some more positions and screenshot them, as required.
  6. Create /mnt/us/images folder, if it doesn't exist already.
  7. Open kindle explorer and rename the screenshots to something more convenient, as required.
  8. Open kterm. Navigate to folder /mnt/us(this can be done directly in kindle explorer by touching the kterm icon).
  9. Run command
    Code:
    for n in *.png; do /mnt/us/linkss/bin/convert $n -crop 617x617+2+39 /mnt/us/images/$n; done
    This crops the screenshots and saves them under the same names in the /mnt/us/images folder. Note that the crop parameters are for a 212 ppi PW1. For 167ppi and 300ppi resolution kindles, the crop sizes and offsets will be different.
Sample before/after images attached.

Thanks to all for help!
Attached Thumbnails
Click image for larger version

Name:	RuyLopez-full.png
Views:	164
Size:	40.9 KB
ID:	150732   Click image for larger version

Name:	RuyLopez-cropped.png
Views:	169
Size:	18.9 KB
ID:	150733  

Last edited by nasser; 08-07-2016 at 09:12 AM.
nasser is offline   Reply With Quote
Old 08-07-2016, 07:23 AM   #11
Yourcat
Groupie
Yourcat knows the way to San Jose.Yourcat knows the way to San Jose.Yourcat knows the way to San Jose.Yourcat knows the way to San Jose.Yourcat knows the way to San Jose.Yourcat knows the way to San Jose.Yourcat knows the way to San Jose.Yourcat knows the way to San Jose.Yourcat knows the way to San Jose.Yourcat knows the way to San Jose.Yourcat knows the way to San Jose.
 
Posts: 175
Karma: 54048
Join Date: Mar 2016
Device: PW3 5.6.5-usbnet
Typo in 6 & 9: '/mnt/images folder' instead of '/mnt/us/images folder'.

Last edited by Yourcat; 08-07-2016 at 11:20 AM.
Yourcat is offline   Reply With Quote
Old 08-07-2016, 08:36 AM   #12
knc1
Going Viral
knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.knc1 ought to be getting tired of karma fortunes by now.
 
knc1's Avatar
 
Posts: 17,212
Karma: 18210809
Join Date: Feb 2012
Location: Central Texas
Device: No K1, PW2, KV, KOA
Ah, so.
Now you are ready to write a chess, e-book with illustrations your certain will display on a Kindle, since they came from a Kindle.

Shown:
Common Openings: Ruy Lopez, a.k.a: Spanish Opening.

Last edited by knc1; 08-07-2016 at 08:46 AM.
knc1 is offline   Reply With Quote
Old 08-07-2016, 09:18 AM   #13
nasser
Evangelist
nasser ought to be getting tired of karma fortunes by now.nasser ought to be getting tired of karma fortunes by now.nasser ought to be getting tired of karma fortunes by now.nasser ought to be getting tired of karma fortunes by now.nasser ought to be getting tired of karma fortunes by now.nasser ought to be getting tired of karma fortunes by now.nasser ought to be getting tired of karma fortunes by now.nasser ought to be getting tired of karma fortunes by now.nasser ought to be getting tired of karma fortunes by now.nasser ought to be getting tired of karma fortunes by now.nasser ought to be getting tired of karma fortunes by now.
 
nasser's Avatar
 
Posts: 475
Karma: 445678
Join Date: Feb 2010
Device: Too many..
Thanks, Yourcat!
/mnt/us/images it is. Corrected.

Yes, knc1!
That's one of my future projects. For now, light duty kindle hacking is enough fun...
nasser is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
WebReaderViewer - built in image/frame/string/html viewer for kindle Aeris Kindle Developer's Corner 13 11-05-2013 02:11 AM
Kindle paperwhite crop background-image on top/bottom j.puff@ppp.eu Kindle Formats 2 08-28-2013 11:58 AM
Kindle paperwhite crop background-image on top/bottom j.puff@ppp.eu Kindle Developer's Corner 1 08-26-2013 06:02 PM
Auto crop raster image PDF - any software? bthoven PDF 16 09-07-2010 02:55 PM
Failed to load ImageMagick trustno12003 Calibre 2 06-17-2009 12:25 AM


All times are GMT -4. The time now is 04:53 PM.


MobileRead.com is a privately owned, operated and funded community.