bootlogo colour change impossible :(

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
xiao
Posts: 10
Joined: 2018-10-12T03:05:07-07:00
Authentication code: 1152

bootlogo colour change impossible :(

Post by xiao » 2018-10-12T04:14:05-07:00

Hi friends

I'm trying to convert a bmp to BMP, with the explicit requirement, that the file must be a type BMP3.

You see, the Tablet bootloader (NAND.a) can only display special type BMP's, but imagemagick resulting the output really same still the tablet charging animation unable to show the colour change on screen. I think there might be some automatic conversion done which i am not aware of please help


i even tried to convert it using GIMP but the result is always same Tablet cant display the modified colour here

original can work without any problem

Image


Code: Select all

C:\Program Files\ImageMagick-7.0.8-Q8>identify -verbose bat10_og.bmp
Image: bat10_og.bmp
  Format: BMP3 (Microsoft Windows bitmap image (V3))
  Class: DirectClass
  Geometry: 250x120+0+0
  Resolution: 28.34x28.34
  Print size: 8.82145x4.2343
  Units: PixelsPerCentimeter
  Colorspace: sRGB
  Type: TrueColor
  Base type: Undefined
  Endianess: Undefined
  Depth: 8-bit
  Channel depth:
    Red: 8-bit
    Green: 8-bit
    Blue: 8-bit
  Channel statistics:
    Pixels: 30000
    Red:
      min: 0  (0)
      max: 254 (0.996078)
      mean: 33.1387 (0.129956)
      standard deviation: 45.3394 (0.177802)
      kurtosis: 2.05237
      skewness: 1.53295
      entropy: 0.643777
    Green:
      min: 0  (0)
      max: 255 (1)
      mean: 132.986 (0.521512)
      standard deviation: 96.3638 (0.377897)
      kurtosis: -1.59965
      skewness: -0.27711
      entropy: 0.845055
    Blue:
      min: 0  (0)
      max: 243 (0.952941)
      mean: 27.0341 (0.106016)
      standard deviation: 38.711 (0.151808)
      kurtosis: 2.98758
      skewness: 1.66246
      entropy: 0.595906
  Image statistics:
    Overall:
      min: 0  (0)
      max: 255 (1)
      mean: 64.3862 (0.252495)
      standard deviation: 60.1381 (0.235836)
      kurtosis: -0.224223
      skewness: 1.09798
      entropy: 0.694913
  Rendering intent: Perceptual
  Gamma: 0.454545
  Chromaticity:
    red primary: (0.64,0.33)
    green primary: (0.3,0.6)
    blue primary: (0.15,0.06)
    white point: (0.3127,0.329)
  Matte color: grey74
  Background color: white
  Border color: srgb(223,223,223)
  Transparent color: none
  Interlace: None
  Intensity: Undefined
  Compose: Over
  Page geometry: 250x120+0+0
  Dispose: Undefined
  Iterations: 0
  Compression: None
  Orientation: Undefined
  Properties:
    date:create: 2018-10-12T16:15:07+06:00
    date:modify: 1980-01-01T00:00:00+06:00
    signature: df987df152fc4474605aedd64eaf2ef6a147a2039a466ea1d0ec5b17e8684120
  Artifacts:
    verbose: true
  Tainted: False
  Filesize: 120056B
  Number pixels: 30000
  Pixels per second: 30.0165MP
  User time: 0.000u
  Elapsed time: 0:01.000
  Version: ImageMagick 7.0.8-12 Q8 x64 2018-09-23 http://www.imagemagick.org

Modified BOOT can not display it


Image


Code: Select all

C:\Program Files\ImageMagick-7.0.8-Q8>identify -verbose bat10_mod.bmp
Image: bat10_mod.bmp
  Format: BMP3 (Microsoft Windows bitmap image (V3))
  Class: DirectClass
  Geometry: 250x120+0+0
  Resolution: 28.34x28.34
  Print size: 8.82145x4.2343
  Units: PixelsPerCentimeter
  Colorspace: sRGB
  Type: TrueColor
  Base type: Undefined
  Endianess: Undefined
  Depth: 8-bit
  Channel depth:
    Red: 8-bit
    Green: 8-bit
    Blue: 8-bit
  Channel statistics:
    Pixels: 30000
    Red:
      min: 0  (0)
      max: 242 (0.94902)
      mean: 2.82643 (0.0110841)
      standard deviation: 20.3713 (0.0798875)
      kurtosis: 78.2081
      skewness: 8.50404
      entropy: 0.0482079
    Green:
      min: 0  (0)
      max: 255 (1)
      mean: 135.917 (0.533009)
      standard deviation: 98.4736 (0.386171)
      kurtosis: -1.60415
      skewness: -0.284788
      entropy: 0.829691
    Blue:
      min: 0  (0)
      max: 255 (1)
      mean: 161.48 (0.633255)
      standard deviation: 109.793 (0.43056)
      kurtosis: -1.57683
      skewness: -0.492347
      entropy: 0.505114
  Image statistics:
    Overall:
      min: 0  (0)
      max: 255 (1)
      mean: 100.075 (0.39245)
      standard deviation: 76.2126 (0.298873)
      kurtosis: -1.65904
      skewness: 0.40644
      entropy: 0.461004
  Rendering intent: Perceptual
  Gamma: 0.454545
  Chromaticity:
    red primary: (0.64,0.33)
    green primary: (0.3,0.6)
    blue primary: (0.15,0.06)
    white point: (0.3127,0.329)
  Matte color: grey74
  Background color: white
  Border color: srgb(223,223,223)
  Transparent color: none
  Interlace: None
  Intensity: Undefined
  Compose: Over
  Page geometry: 250x120+0+0
  Dispose: Undefined
  Iterations: 0
  Compression: None
  Orientation: Undefined
  Properties:
    date:create: 2018-10-12T16:15:07+06:00
    date:modify: 2018-10-12T16:15:07+06:00
    signature: 76a8267cbba9648e54f509cd21d77fe250063a171c6faf177f6c84d4ecaaa07e
  Artifacts:
    verbose: true
  Tainted: False
  Filesize: 90294B
  Number pixels: 30000
  Pixels per second: 30.0165MP
  User time: 0.000u
  Elapsed time: 0:01.000
  Version: ImageMagick 7.0.8-12 Q8 x64 2018-09-23 http://www.imagemagick.org
Last edited by xiao on 2018-10-12T08:09:35-07:00, edited 2 times in total.

snibgo
Posts: 10709
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: bootlogo colour change impossible :(

Post by snibgo » 2018-10-12T04:57:05-07:00

How about:

Code: Select all

magick bat10-og.png -type palette -compress None bmp3:out.bmp
snibgo's IM pages: im.snibgo.com

xiao
Posts: 10
Joined: 2018-10-12T03:05:07-07:00
Authentication code: 1152

Re: bootlogo colour change impossible :(

Post by xiao » 2018-10-12T05:02:04-07:00

i can test please give me few minutes to post result

bad :(

Code: Select all

magick bat10-og.png -type palette -compress None bmp3:out.bmp
same result TAB unable to display the edited file ....please excuse my english

here is the original archive if interested ..which need to change the colour of green to blue

https://www.sendspace.com/file/m0xfah

snibgo
Posts: 10709
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: bootlogo colour change impossible :(

Post by snibgo » 2018-10-12T06:24:40-07:00

My result is BMP3, with palette, and no compression. What else does it need to be?
snibgo's IM pages: im.snibgo.com

xiao
Posts: 10
Joined: 2018-10-12T03:05:07-07:00
Authentication code: 1152

Re: bootlogo colour change impossible :(

Post by xiao » 2018-10-12T07:01:01-07:00

i guess you are not getting me my i want to change the colour of battery animation in my tablet but only original files work if i replace anything or modifi anything like above i modified colour it doesnt show that it shows wired animation or picture which is hardly recognizable so i want to know how original files work but when modified it shows unrecognizable colour or like blurred there must be some more settings to picture

can we set Blue COLOUr with instead of green within ImageMagic? and also convert the required format?

right now what i am doing is using Gimp or Inkscape for colour change than exporting the original image from BMP TO PNG than converting PNG to BMP with imageMagick to fit into the parameters required by TABLET


please help me out i have tried almost everything what i know from WWW

User avatar
fmw42
Posts: 23855
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: bootlogo colour change impossible :(

Post by fmw42 » 2018-10-12T13:16:06-07:00

To change color, try -modulate.

Code: Select all

convert bat10-og.png -modulate 100,100,133 -type palette -compress none BMP3:result.bmp

See https://imagemagick.org/Usage/color_mods/#color_mods

snibgo
Posts: 10709
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: bootlogo colour change impossible :(

Post by snibgo » 2018-10-12T13:41:21-07:00

xiao wrote:can we set Blue COLOUr with instead of green within ImageMagic? and also convert the required format?
Changing the colour is easy. But we don't know what format is needed.
snibgo's IM pages: im.snibgo.com

xiao
Posts: 10
Joined: 2018-10-12T03:05:07-07:00
Authentication code: 1152

Re: bootlogo colour change impossible :(

Post by xiao » 2018-10-13T01:06:54-07:00

snibgo wrote:
2018-10-12T13:41:21-07:00
xiao wrote:can we set Blue COLOUr with instead of green within ImageMagic? and also convert the required format?
Changing the colour is easy. But we don't know what format is needed.
oh bro both the formats are BMP clearly

1=see First post original with green colour with information which works in the ANDROID TABLET

2=see first post Modified by me in gimp WITH BLUE colour with information which does not work in android Tablet (i want this colour in battery icon and also want it to work in TABLET)

xiao
Posts: 10
Joined: 2018-10-12T03:05:07-07:00
Authentication code: 1152

Re: bootlogo colour change impossible :(

Post by xiao » 2018-10-13T01:23:37-07:00

fmw42 wrote:
2018-10-12T13:16:06-07:00
To change color, try -modulate.

Code: Select all

convert bat10-og.png -modulate 100,100,133 -type palette -compress none BMP3:result.bmp

See https://imagemagick.org/Usage/color_mods/#color_mods
colour changed perfectly by your command thanks sir (i learned one thing today) but problem remains same when i write it to the TABLET ANIMATION it unable to show the change in place of our modification it shows weird,blurred thing which is beyond recognition :(

and i noticed original icon is 118kb after command it become 89kb does it make any difference

User avatar
fmw42
Posts: 23855
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: bootlogo colour change impossible :(

Post by fmw42 » 2018-10-13T09:05:45-07:00

I do not understand your "TABLET ANIMATION". What is that? If you are saying that the results above do not display properly in some other software, then provide an example image that does and we can try to see what is different.

xiao
Posts: 10
Joined: 2018-10-12T03:05:07-07:00
Authentication code: 1152

Re: bootlogo colour change impossible :(

Post by xiao » 2018-10-14T01:55:53-07:00

example original images which can work in tablet animation is below i already provided and in the first post i already show the both details original image and modified image with details of each

https://www.sendspace.com/file/m0xfah

or

https://github.com/pcduino/a20-kernel/t ... fs/os_show

you can take any image from the link

..
bat0.bmp
bat1.bmp
bat10.bmp
bat2.bmp
bat3.bmp
bat4.bmp
bat5.bmp
bat6.bmp
bat7.bmp
bat9.bmp


after any modification of any of the above image can not display properly in TABLET ANIMATION(the animation any phone show while power off when charging battery) i hope its clear now

User avatar
fmw42
Posts: 23855
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: bootlogo colour change impossible :(

Post by fmw42 » 2018-10-14T10:38:12-07:00

Your input is not 9-bit palette but truecolor (24-bit) BMP3. So try this

Code: Select all

convert bat10.bmp -modulate 100,100,133 -compress none BMP3:result.bmp
When I compare the Imagemagick verbose information, it appears to similar.

EXIFTOOL says your image is bit depth 32, but there is no alpha channel. The above creates a bit depth of 24. So your file has bad meta data.

BMP3 does not formally support bit-depth of 32. Only BMP/BMP4 supports that properly.

So you can try using EXIFTOOL to edit the result of my first command to change the 24-bit bit depth to 32

See https://www.sno.phy.queensu.ca/~phil/exiftool/ and https://www.sno.phy.queensu.ca/~phil/ex ... l_pod.html

But according to https://www.sno.phy.queensu.ca/~phil/ex ... s/BMP.html, you cannot write over the BitDepth tag. So I am not sure what to tell you. Your file meta data is not accurate for BMP3.

xiao
Posts: 10
Joined: 2018-10-12T03:05:07-07:00
Authentication code: 1152

Re: bootlogo colour change impossible :(

Post by xiao » 2018-10-16T03:48:48-07:00

what command i shoud use to write metadata?I tried

exiftool -tag=32 result.bmp
Warning: Tag 'tag' is not defined
Nothing to do.

exiftool -tag=32 -w result.bmp
No file specified

exiftool -w -tag=32 result.bmp
1 output files created

1kb file created by the name..... result.-tag=32 <=========what to do with that?


when i open this file in NotePad its shows

ExifTool Version Number : 11.13
File Name : result.bmp
Directory : .
File Size : 88 kB
File Modification Date/Time : 2018:10:16 16:06:30+05:30
File Access Date/Time : 2018:10:16 16:06:30+05:30
File Creation Date/Time : 2018:10:16 16:06:30+05:30
File Permissions : rw-rw-rw-
File Type : BMP
File Type Extension : bmp
MIME Type : image/bmp
BMP Version : Windows V3
Image Width : 250
Image Height : 120
Planes : 1
Bit Depth : 24
Compression : None
Image Length : 90240
Pixels Per Meter X : 2834
Pixels Per Meter Y : 2834
Num Colors : Use BitDepth
Num Important Colors : All
Image Size : 250x120
Megapixels : 0.030

xiao
Posts: 10
Joined: 2018-10-12T03:05:07-07:00
Authentication code: 1152

Re: bootlogo colour change impossible :(

Post by xiao » 2018-10-16T04:34:31-07:00

i also found a thread with a similar problem where IM was not preserving alpha but that was fixed long ago and in my case no alpha

http://www.imagemagick.org/discourse-se ... =1&t=28733


i guess we are near to the solution and you have got the correct nerve its a BitDepth problem i also think same

User avatar
fmw42
Posts: 23855
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: bootlogo colour change impossible :(

Post by fmw42 » 2018-10-16T09:29:01-07:00

I do not know any tool that will change the BitDepth. The BMP format link I mentioned above says it is not changeable.

Post Reply