Changing the leading space in image
Changing the leading space in image
Is there anyway i can change the leading space of text lines in images so that it appears larger?
-
- Posts: 12159
- Joined: 2010-01-23T23:01:33-07:00
- Authentication code: 1151
- Location: England, UK
Re: Changing the leading space in image
If you mean in...
... etc, then just put in a leading space or two, and perhaps also trailing spaces:
Code: Select all
label:"Hello world"
Code: Select all
label:" Hello world "
snibgo's IM pages: im.snibgo.com
Re: Changing the leading space in image
i mean line-spacing in actual images:
"aaaa
bbbbb"
i would like it to be changed to :
"aaaa
bbbb
"
Something like that
"aaaa
bbbbb"
i would like it to be changed to :
"aaaa
bbbb
"
Something like that
Re: Changing the leading space in image
But that only works on raw text input into command line. How can i make it work with existing image ?
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: Changing the leading space in image
I am not sure what you mean by existing images?user20157 wrote:But that only works on raw text input into command line. How can i make it work with existing image ?
Once you have raster data you would have to do OCR to get the text again and then regenerate the image with a different interline-spacing.
Or you would have to crop out each row of text and then composite it back onto a white background with different offsets (-geometry), so that there is more space between lines of text.
If I misunderstand, please clarify further.
Re: Changing the leading space in image
My problem is that OCR like Tesseract doesn't extract text from the images as accurately as i expected. Thats why i want to try to increase the line spacing so that i can see any improvement or not.
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: Changing the leading space in image
Perahps you should upload an example of your image to some place such as dropbox.com and put the URL here, so we can see your image and perhaps offer appropriate suggestions.
Always best to provide your IM version and platform when asking questions, since syntax may differ.
See viewtopic.php?f=1&t=9620
Always best to provide your IM version and platform when asking questions, since syntax may differ.
See viewtopic.php?f=1&t=9620
Re: Changing the leading space in image
My original image is : http://imgur.com/NralART
I want something look like this :http://imgur.com/xKoKlS
My IM version: 6.9.3-0 Q16 x64
Platform:Windows 10 command line
Thank you very much,
I want something look like this :http://imgur.com/xKoKlS
My IM version: 6.9.3-0 Q16 x64
Platform:Windows 10 command line
Thank you very much,
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: Changing the leading space in image
Invalid link for http://imgur.com/xKoKlS
Did we not go into a similar issue with you at viewtopic.php?f=1&t=28967.
I do not think changing the spacing between lines will do much good.
The only way I know to do that, is to separate out each line and recomposite together. To separate out each line, you can average the image into 1 column and look for white spaces. They are the coordinates that separate the black text. Crop each row at those spacings and recomposite them back with more space between them.
Did we not go into a similar issue with you at viewtopic.php?f=1&t=28967.
I do not think changing the spacing between lines will do much good.
The only way I know to do that, is to separate out each line and recomposite together. To separate out each line, you can average the image into 1 column and look for white spaces. They are the coordinates that separate the black text. Crop each row at those spacings and recomposite them back with more space between them.
Re: Changing the leading space in image
Could you please elaborate more on sentence "average the image into 1 column" ?
Re: Changing the leading space in image
My second link image is : http://imgur.com/eBn6lKv
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: Changing the leading space in image
With accent marks above and below text characters, my concept of averaging to one column is not going to work. But if you want to try
The txt: will list the column pixel values to the terminal or you can write them to a string or to a text file for further analysis.
Code: Select all
convert image -resize 1x! txt:
Re: Changing the leading space in image
Code: Select all
0,0: (64533,64505,64505,65535) #FBFBFBFF srgba(251,251,251,1)
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: Changing the leading space in image
The values are red, green, blue and alpha (not yellow). The 0,0 is the x,y coordinate for that pixel's color. You should be getting a whole column of values not just for 0,0. The r,g,b,a values in parens are "raw" values in your IM compile. If Q16 then 0 to 65535, if Q8 then 0 to 255.