Posts: 893
Threads: 197
Joined: Jul 2014
Reputation:
0
09-21-2017, 09:48 AM
(This post was last modified: 06-08-2018, 09:56 AM by m654321.)
The other day, while using LL3.6, I needed to convert a *.png image file to an *.jpg one, before I could upload it to a website. I found the solution and thought I would share it with you - it's dead easy, which is what I like ...
It works in the terminal, through the imagemagick application (which is pre-installed on LL3.6), as far as I'm aware.
1. Open terminal
2. Type:
Code: convert image.png image.jpg
... where "image" is the name of your image file
However, you will need to indicate where image.png is located. For example, if it is in 'Downloads' folder, then type: Code: convert /home/[username]/Downloads/image.png image.jpg
It will then leave an image.jpg version of the file in 'Downloads', alongside the image.png one.
Other information:- it will keep the original file you started with, i.e. it won't be deleted during conversion
- other image file types can be converted (e.g. *.gif, *.bmp, *.tif), and in any direction, e.g. bmp to jpg or jpg to bmp, etc
- for batch files (those which contain commands), replace convert with mogrify
- the convert command can be used to rotate or resize images - for further details see https://www.lifewire.com/convert-linux-c...nd-4097060
64bit OS (32-bit on Samsung[i] netbook) installed in [i]Legacy mode on MBR-formatted SSDs (except pi which uses a micro SDHC card):
2017 - Raspberry pi 3B (4cores) ~ [email protected] - LibreElec, used for upgrading our Samsung TV (excellent for the task)
2012 - Lenovo G580 2689 (2cores; 4threads] ~ [email protected] - LL3.8/Win8.1 dual-boot (LL working smoothly)
2011 - Samsung NP-N145 Plus (1core; 2threads) ~ Intel Atom [email protected] - LL 3.8 32-bit (64-bit too 'laggy')
2008 - Asus X71Q (2cores) ~ Intel [email protected] - LL4.6/Win8.1 dual-boot, LL works fine with kernel 4.15
2007 - Dell Latitude D630 (2cores) ~ Intel [email protected] - LL4.6, works well with kernel 4.4; 4.15 doesn't work
Posts: 936
Threads: 24
Joined: Dec 2016
Reputation:
0
Nice!
I usually use Gimp. But this is cool.
It's like having a scanner plugged in and works right away... take THAT Bill!
No drivers-fidling session.
- TheDead (TheUxNo0b)
If my blabbering was helpful, please click my [Thank] link.
Posts: 893
Threads: 197
Joined: Jul 2014
Reputation:
0
[member=6733]TheDead[/member]
Glad it was useful
Mike
64bit OS (32-bit on Samsung[i] netbook) installed in [i]Legacy mode on MBR-formatted SSDs (except pi which uses a micro SDHC card):
2017 - Raspberry pi 3B (4cores) ~ [email protected] - LibreElec, used for upgrading our Samsung TV (excellent for the task)
2012 - Lenovo G580 2689 (2cores; 4threads] ~ [email protected] - LL3.8/Win8.1 dual-boot (LL working smoothly)
2011 - Samsung NP-N145 Plus (1core; 2threads) ~ Intel Atom [email protected] - LL 3.8 32-bit (64-bit too 'laggy')
2008 - Asus X71Q (2cores) ~ Intel [email protected] - LL4.6/Win8.1 dual-boot, LL works fine with kernel 4.15
2007 - Dell Latitude D630 (2cores) ~ Intel [email protected] - LL4.6, works well with kernel 4.4; 4.15 doesn't work
Posts: 1,133
Threads: 87
Joined: Sep 2017
Reputation:
0
Hi. Another way to do this is by selecting the *png file, right click on it and then select save a copy, in the saving window simply name the file adding the *jpg extension and save it, that's it. ;D
Posts: 936
Threads: 24
Joined: Dec 2016
Reputation:
0
[member=7109]Moltke[/member]
Dunno about this on, maybe it just renames the file with another extension.
ADD : Just tried it, I dont have "Save a copy' in my Linux Lite 3.6, just "Create a backup copy" that clones it.
(insert Twilight Zone music)
or you just have an add-on
Cheers!
- TheDead (TheUxNo0b)
If my blabbering was helpful, please click my [Thank] link.
Posts: 1,133
Threads: 87
Joined: Sep 2017
Reputation:
0
(09-21-2017, 09:31 PM)TheDead link Wrote: [member=7109]Moltke[/member]
Dunno about this on, maybe it just renames the file with another extension.
ADD : Just tried it, I dont have "Save a copy' in my Linux Lite 3.6, just "Create a backup copy" that clones it.
(insert Twilight Zone music)
or you just have an add-on
Cheers! Yes my bad. I just checked and for "save a copy" you have to open the *png file in ristretto, click on "file" menu and there it is; "save a copy" then simply when saving rename it adding the *jpg extension and that's it. Guess I forgot this "little" detail. Sorry about that
Posts: 893
Threads: 197
Joined: Jul 2014
Reputation:
0
09-22-2017, 05:47 AM
(This post was last modified: 09-22-2017, 09:48 AM by m654321.)
(09-21-2017, 09:11 PM)Moltke link Wrote: Hi. Another way to do this is by selecting the *png file, right click on it and then select save a copy, in the saving window simply name the file adding the *jpg extension and save it, that's it. ;D
Are you sure that renaming a file = converting the file format?
I'm certainly no expert by any measure, but this doesn't seem right. Following the same logic one could suffix linux driver names with *.exe to make them work in Windows, which of course is not the case....
Could someone with some knowledgeable overview on this please comment?
I don't mean any disrespect towards you Moltke, whatsoever, when I say that and I hope it doesn't come across that way - I may well be incorrect with the comment I've made.
Many thanks
Mike
64bit OS (32-bit on Samsung[i] netbook) installed in [i]Legacy mode on MBR-formatted SSDs (except pi which uses a micro SDHC card):
2017 - Raspberry pi 3B (4cores) ~ [email protected] - LibreElec, used for upgrading our Samsung TV (excellent for the task)
2012 - Lenovo G580 2689 (2cores; 4threads] ~ [email protected] - LL3.8/Win8.1 dual-boot (LL working smoothly)
2011 - Samsung NP-N145 Plus (1core; 2threads) ~ Intel Atom [email protected] - LL 3.8 32-bit (64-bit too 'laggy')
2008 - Asus X71Q (2cores) ~ Intel [email protected] - LL4.6/Win8.1 dual-boot, LL works fine with kernel 4.15
2007 - Dell Latitude D630 (2cores) ~ Intel [email protected] - LL4.6, works well with kernel 4.4; 4.15 doesn't work
Posts: 1,133
Threads: 87
Joined: Sep 2017
Reputation:
0
09-22-2017, 10:53 AM
(This post was last modified: 09-22-2017, 12:38 PM by Moltke.)
(09-22-2017, 05:47 AM)m654321 link Wrote: [quote author=Moltke link=topic=4614.msg35184#msg35184 date=1506028289]
Hi. Another way to do this is by selecting the *png file, right click on it and then select save a copy, in the saving window simply name the file adding the *jpg extension and save it, that's it. ;D
Are you sure that renaming a file = converting the file format?
I'm certainly no expert by any measure, but this doesn't seem right. Following the same logic one could suffix linux driver names with *.exe to make them work in Windows, which of course is not the case....
Could someone with some knowledgeable overview on this please comment?
I don't mean any disrespect towards you Moltke, whatsoever, when I say that and I hope it doesn't come across that way - I may well be incorrect with the comment I've made.
Many thanks
Mike
[/quote]
hI [member=458]m654321[/member]
Well, first of all is not as simple as that, I forgot and I did mentioned in another comment, that for that to work you have to open the *png file in ristretto then click on "file menu" select "save a copy", when saving rename the file adding the *jpg extension and that's it. It worked for me. However, I did noticed that ristretto doesn't recognize the new file as a *jpg file while image magick does. Regarding your coment "Following the same logic one could suffix linux driver names with *.exe" this won't work because an *.exe file has some other attributes/properties which you can't just change by renaming it. I know this method can work on certain file types like images and texts, at least in windows it is possible check this out https://www.techwalla.com/articles/how-t...rar-to-cbr. I guess it should be possible in Linux too. ;D
Posts: 936
Threads: 24
Joined: Dec 2016
Reputation:
0
(09-21-2017, 09:48 PM)Moltke link Wrote: Yes my bad. I just checked and for "save a copy" you have to open the *png file in ristretto, click on "file" menu and there it is; "save a copy" then simply when saving rename it adding the *jpg extension and that's it. Guess I forgot this "little" detail. Sorry about that
NP, I'll have a look at Ristretto in the future. I havent really looked for a quick viewer, I've been using xnview for year on 'doze, one of the first program I usually install to replace the too-basic one in this OS
- TheDead (TheUxNo0b)
If my blabbering was helpful, please click my [Thank] link.
Posts: 893
Threads: 197
Joined: Jul 2014
Reputation:
0
09-26-2017, 03:34 PM
(This post was last modified: 09-26-2017, 03:38 PM by m654321.)
(09-22-2017, 10:53 AM)Moltke link Wrote: Hi. Another way to do this is by selecting the *png file, right click on it and then select save a copy, in the saving window simply name the file adding the *jpg extension and save it, that's it. ;D
Thanks Moltke - I overlooked that detail - thankyou for pointing it out to me as I didn't know about that option.
I quite like the terminal method for changing the image format as it's so simple & direct.
I mentioned batch files in post #1 - do you know if Ristretto can also convert the format of those too?
Cheers
Mike
64bit OS (32-bit on Samsung[i] netbook) installed in [i]Legacy mode on MBR-formatted SSDs (except pi which uses a micro SDHC card):
2017 - Raspberry pi 3B (4cores) ~ [email protected] - LibreElec, used for upgrading our Samsung TV (excellent for the task)
2012 - Lenovo G580 2689 (2cores; 4threads] ~ [email protected] - LL3.8/Win8.1 dual-boot (LL working smoothly)
2011 - Samsung NP-N145 Plus (1core; 2threads) ~ Intel Atom [email protected] - LL 3.8 32-bit (64-bit too 'laggy')
2008 - Asus X71Q (2cores) ~ Intel [email protected] - LL4.6/Win8.1 dual-boot, LL works fine with kernel 4.15
2007 - Dell Latitude D630 (2cores) ~ Intel [email protected] - LL4.6, works well with kernel 4.4; 4.15 doesn't work
|