Wikipedia:Reference desk/Archives/Computing/2016 October 3
Computing desk | ||
---|---|---|
< October 2 | << Sep | October | Nov >> | October 4 > |
Welcome to the Wikipedia Computing Reference Desk Archives |
---|
The page you are currently viewing is an archive page. While you can leave answers for any questions shown below, please ask new questions on one of the current reference desk pages. |
October 3
[edit]Manipulating images
[edit]Hi all--I need something easy to help me manipulate some images. Specifically, I have eight gifs I need to combine into a single jpg. My PC is nothing special and I have no special graphic software, and I am hoping to do this with the stuff I have which includes Picture Manager and standard Windows stuff. I have Image Processor but I have no idea what it is or does. Your help is much appreciated. Drmies (talk) 14:47, 3 October 2016 (UTC)
- Are the GIFs animated? (assuming the're not animated) If you mean to put them together in an array in a single larger image (e.g. a row like a filmstrip), you can do that with ImageMagick's montage function. -- Finlay McWalter··–·Talk 14:54, 3 October 2016 (UTC)
- Thanks, Finlay McWalter. (No, nothing's animated.) I'm looking at their website. There's 13 versions for Windows, and I don't know what the difference between static and dynamic means. Don't overestimate me: I don't even know what the difference is between Win64 and Win32. Wait--I have Windows 7 Enterprise, 32-bit, so that cuts out a few options. So--dynamic or static? 16 bits per pixel or 8 bits per pixel? Drmies (talk) 15:06, 3 October 2016 (UTC)
- ImageMagick-7.0.3-2-Q16-x86-dll.exe -- Finlay McWalter··–·Talk 15:10, 3 October 2016 (UTC)
- Thanks. If this works I'll put you on retainer. Drmies (talk) 16:33, 3 October 2016 (UTC)
- ImageMagick-7.0.3-2-Q16-x86-dll.exe -- Finlay McWalter··–·Talk 15:10, 3 October 2016 (UTC)
- GNU Image Manipulation Program is very powerful, but will take a little more effort to learn. It can work with layered images and combine them using masks, transparency, or user-specified methods. Nimur (talk) 15:02, 3 October 2016 (UTC)
- Ha I'm looking for low learning curve. I remember vaguely what layers are, from way back when, when I had some hijacked copy of PhotoShop or whatever it was called--but I know I don't need to mask, transpare, dither, wax, or wox. Drmies (talk) 15:06, 3 October 2016 (UTC)
- How do you want the images combined? Do you want to make side-by-side, 2x4, 4x2, or some such composite image from several images, like a cartoon strip from individual cartoon frames? Or something more complex, with elements of one image cut and inserted into other images? 91.155.195.247 (talk) 15:41, 3 October 2016 (UTC)
- Very simple--two columns of four will likely fit. Eight of these, really--nothing fancy, so that they'll fit on one printed page. Drmies (talk) 16:33, 3 October 2016 (UTC)
- (edit conflict)@Drmies: I think the lowest-tech solution, since you run Win7, is to use Paint. Open one window of Paint for the final picture, then for every picture:
- Open it in another Paint window: either from Paint itself do "open"/ctrl+O, or right-click from explorer -> "open with" -> paint (ask for more programs if necessary)
- Copy its content with the selection tool: the shortcut is ctrl-A (select all) then ctrl-C (or ctrl-X) to copy, otherwise "select" "rectangular selection" and click-drag to have the whole picture
- Paste the result into the final picture window: go to there, and then ctrl-V or right-click -> "paste". Click and drag to place it as you wish.
- Close the original image paint window.
- Once this is done for all photos, save the result (ctrl-S or file tab -> save) in the correct format.
- As you can imagine, there are plenty of reasons why this is not an optimal solution. Some of those are linked with the fact that Paint uses raster graphics rather than vector graphics, i.e. the images are considered as arrays of color bits rather than as sums of lines, circles etc. - while it is legitimate for photographs, it still limits the possibilities of edition. (JPEG images are a bit more complicated, but basically it is the same.)
- First of all, if you need to resize your images to fit them in the final image, there may be big artifacts in the final image (bigger than with other software solutions). If you intend to process 80 instead of 8 images, it may be time to learn to automate the process. Gif to jpg is probably not a good idea, compression-wise. And of course Paint
eats your soulis non-free software with inferior abilities to pretty much everything else. - LibreOffice Draw is maybe the simplest-to-learn free equivalent, but less powerful than either of the previous suggestions (ImageMagick or GIMP), or (my favorite, but only because I am used to it), Inkscape. TigraanClick here to contact me 16:37, 3 October 2016 (UTC)
- In the end this needs to be printed (in a book--a real book) so I need to have at least decent quality--the publisher requires jpg. I thought about bitmap but that means conversion to bmp and then conversion to jpg (right?) which means quality loss. So I suppose I'll try one of the options y'all are giving me here--thanks! Drmies (talk) 16:41, 3 October 2016 (UTC)
- If your publisher requires .jpg, cancel the deal. I am only semi-joking here. I see no good reason to require jpg-only pictures. Jpg images are lighter for the "same" resolution, measured in pixel size (again, JPEG is the place to read about this), but if that is the issue, they could (and should) give you a size limit of some sort rather than imposing an arbitrary format. If anything, some of the pictures you linked may actually be lighter in other, lossless compression formats such as gif (lots of white space). TigraanClick here to contact me 17:12, 3 October 2016 (UTC)
- In total seriousness, JPEG is not the best format for these images. It will require great caution and a good deal of technical expertise to turn your source images - line-diagrams and text - into good-quality JPEG files that do not have severe visible defects (text and lines provide excellent examples of compression artifacts). It is possible to make a good-quality JPEG that contains lines and text, but it requires great care, expertise, and attention to detail - not to mention, difficult-to-use software tools that let you specify intricate technical details of the compression algorithm. If you are going to be printing such diagrams, certain other file-formats like PNG are preferable. Of course, you can introduce image defects into any file format, if you aren't careful.
- Maybe it is worth enlisting the help of a professional graphic designer? Once your image file is committed to the publisher and/or printer, you won't be able to fix any defects. A graphics-professional might be worth what you end up paying them.
- Nimur (talk) 17:35, 3 October 2016 (UTC)
- Agree that JPEG is a bad format for this kind of images - JPEG is, after all, the Joint Photographic Expert Group, and is designed to provide good quality for typical photographic images, with colour gradients and smooth shapes and transitions. It is not very good for line art. As for the practical approach: If it's a one-off, I use Apples Keynote, arrange the images manually in a slide with right proportions, then export to PDF. I'm fairly sure that Powerpoint should be able to do something similar. If I'd care about quality and automation, Imagemagick as suggested above is the way to go. --Stephan Schulz (talk) 18:39, 3 October 2016 (UTC)
- If your publisher requires .jpg, cancel the deal. I am only semi-joking here. I see no good reason to require jpg-only pictures. Jpg images are lighter for the "same" resolution, measured in pixel size (again, JPEG is the place to read about this), but if that is the issue, they could (and should) give you a size limit of some sort rather than imposing an arbitrary format. If anything, some of the pictures you linked may actually be lighter in other, lossless compression formats such as gif (lots of white space). TigraanClick here to contact me 17:12, 3 October 2016 (UTC)
- In the end this needs to be printed (in a book--a real book) so I need to have at least decent quality--the publisher requires jpg. I thought about bitmap but that means conversion to bmp and then conversion to jpg (right?) which means quality loss. So I suppose I'll try one of the options y'all are giving me here--thanks! Drmies (talk) 16:41, 3 October 2016 (UTC)
Fun game for competitive coding?
[edit]Hey, friendly Wikipedians, I don't suppose i could trouble you for help on an inane but (I hope) interesting question? So me and a group of friends want to play a game where we code up AIs to play a relatively simple game, and pit them off against each other. None of us are pros, we're basically doing this just to refine some skills and have a bit of fun. We were thinking chess, but ruled it out because unless you're prepared to get way more than casually into it that will just evolve into refining a minimax. Basically, therefore, we're looking for something with no obvious heuristic other than victory. We looked at various variations of capture the flag but couldn't come up with a simple version which didn't just incentivise ultra-defensive play. I don't suppose any of you might know offhand something which would suit our purposes? Many thanks! 176.27.136.246 (talk) 22:24, 3 October 2016 (UTC)
- Don't have a firm suggestion (sorry!), but this is an interesting question.. perhaps a platformer of some sort (the victory being the quickest time)? -- samtar talk or stalk 22:31, 3 October 2016 (UTC)
- Designing a competitive AI for Pong makes for an incredibly awesome, simple, fun programming challenge.
- You can pit your AIs against each other and see who wins. You might be surprised at how complex this simple game can become, when you pit AIs against each other. If you find that your players are "too perfect," you can add constraints (if needed); or you can accelerate the game-simulation-speed to super-human levels.
- A few years ago, friends and I played the Ant Farm AI challenge... that game had very simple rules, but the mathematics of designing a winning strategy became so amazingly complex that I think we both dropped out after just a few iterations of the game. The point, if anything, is that even incredibly simple game-rules lend themselves to profoundly complex artificial intelligence strategies.
- Nimur (talk) 22:33, 3 October 2016 (UTC)
- I once greatly enjoyed a competition consisting of writing an AI for a simple car-racing game. There wasn't even terrain: just a planar region containing a series of checkpoints to touch (within some distance) to constitute a lap. It is nonetheless highly non-trivial if you include collisions between cars; the version we used also added simple weapons (à la the green shell from Mario Kart). --Tardis (talk) 02:10, 4 October 2016 (UTC)
- Perhaps boring, but easy: Connect 4 or Battleship (game). You might want to impose a per-move or global time limit. --Stephan Schulz (talk) 02:30, 4 October 2016 (UTC)
- The iterated prisoner's dilemma has been played as a tournament for AIs. For novices it has the advantage that the rules are almost trivially simple, and one can write a pretty simple AI that plays well, but one can also make the AI quite sophisticated if one wishes. CodeTalker (talk) 02:51, 4 October 2016 (UTC)
- Iterated rock–paper–scissors is also very difficult to play well, and has been the subject of numerous academic papers (such as this one). See if you can beat the top-ranked algorithms here. -- BenRG (talk) 22:54, 4 October 2016 (UTC)
- In my younger years, we had to code an "IA" for one of the zillion variants of awele. There is no obvious heuristic, and the tree is large enough to guarantee you cannot brute-force the minimax. However, you need one boring hour of coding the rules of the game (how stuff moves and is captured). Some of us managed to code the alpha-beta pruning that beated most of the prof's programs (the ones that played at random, or minimax with some "clever" evaluation heuristics), but transposition tables and negascout was a bit too much for us to do within three hours.
- BTW, most if not all algorithms that were developed for in the "chess beats human" years are variants of "refining the alpha-beta pruning". In recent years there has been some machine learning and that is conceptually different (see AlphaGo) but that is probably beyond the abilities of for-fun coders. TigraanClick here to contact me 07:23, 4 October 2016 (UTC)
- There used to be a guy here named "Steve Baker". He had some programs designed specifically for competitive coding. I remember seeing one that looked like dinosaurs. I believe that you programmed the AI for your dino and then they fought. He surely has some way to find it on his personal website: https://www.sjbaker.org/ 209.149.113.4 (talk) 15:36, 4 October 2016 (UTC)
- @SteveBaker: you were mentioned above. :-) --CiaPan (talk) 16:58, 4 October 2016 (UTC)
- Hi! Yes - the software still exists - it's called "botzilla" and you can download it from the Botzilla Sourceforge project. Each player provides a "DLL" for Windows (or a ".so" file under Linux) that controls one of the robots in the game. You play as gigantic robotic dinosaurs (or whatever) - trying to kill all of the other bots and be the last one standing. Gameplay happens in a simple grid-like city with a forcefield around it. To keep games to a reasonable length, the forcefield starts to shrink inwards after a few minutes, forcing the robots together.
- Each turn, your software is provided with a low-rez "map" of what your bot can see around it - and on the basis of that, has to decide the direction and speed to move your bot - and also whether you want to shoot, stomp or "rage". There are various collectables scattered through the city that get you benefits of one kind or another. Gameplay can be one-on-one or many-on-many. Moving through a building slows you down (and destroys the building - which is pretty satisfying!).
- Bots can also output text into a speech balloon over their heads - it has no effect on gameplay - but is good for 'trash talking' the opposition and for debugging!
- I worked hard to make it an interesting spectator sport as well as a challenge for the players - so get a big-screen TV with a crowd of people (preferably with beer!) cheering for the winners. It even supports red/cyan 3D glasses!
- When the competition is running, the software will make an effort to produce cool camera angles - but a human operator has the ability to move the camera manually and/or switch between standard viewpoints.
- The package comes with some sample 'bot' programs - including a couple that won competitions when I last ran this...there is also a bot program that you can drive with a joystick to make the game human-playable!
- Sadly, the code is very old - and hasn't be touched for about 10 years - so it may be a little 'dusty'.
- SteveBaker (talk) 19:15, 4 October 2016 (UTC)
- You could do a 13 cells wide and at 28 cells tall (with cells above 25 being hidden), pentomino version of tetris. Pentomino means that unlike tetris pieces that are made of One-sided tetromino pieces, your game will will have pieces made out of 5 square tiles, so One-sided pentomino ones (the gameplay area was adjusted from 10 wide to 22 tall because of that). Both players would play at the same time, and if you want one player to influence the other, you could include a rule that if you clear 5 lines in a row, the next bag the other player will receive will be a bag of one sided hexomino.177.92.128.26 (talk) 14:09, 6 October 2016 (UTC)
Alternative to Vicuña uploader?
[edit]Is there a good alternative to Vicuña uploader for Windows (10), which I had been using to upload groups of photos to Commons? It stopped working for me yesterday. I installed it on another Windoes 10 computer and it won't work on it either. I suspect that a Windows 10 update caused it to stop working. Bubba73 You talkin' to me? 23:36, 3 October 2016 (UTC)
- There are many alternatives, including these standalone desktop applications. Nimur (talk) 23:41, 3 October 2016 (UTC)
- I'll check some out. Since I wrote the message and got your reply, I tried The Commonist (the only other one I was able to find). It did not work well. It uploaded only one of the six files I selected, The fifth of six did upload, even though the progress bar went across on each of the files, the others all failed. Its interface is bad - there doesn't seem to be a way to copy the file name, description, and categories from one file to the next (sometimes I'm uploading dozens with the same info), and it did not rename the file as I told it to. Bubba73 You talkin' to me? 00:08, 4 October 2016 (UTC)
- PattyPan doesn't seem to do what I want to do. I tried to download ComeOn! - a Java screen came up and dots went across, but then it closed without doing anything. Bubba73 You talkin' to me? 00:27, 4 October 2016 (UTC)
- Well, Vicuna works a little bit, once in a while. It successfully uploaded a set of three photos to Commons, although it had great difficulty logging in. Then I tried up upload a set of 12, but only the first one got uploaded. I exited to start the program again, and now it can't log in. Could the problem be with Commons? Bubba73 You talkin' to me? 02:58, 6 October 2016 (UTC)
- And now I can get it to log in, but the selected photos don't show up in the thumbnails, so they won't upload. Bubba73 You talkin' to me? 03:01, 6 October 2016 (UTC)