The question is pretty much summed up by the title - I've just built a kernel which has generated the vmlinux output file. How do I compress this into a vmlinuz image?
Compression is a compile-time option.
The process is quite tricky, as the resulting file will start with native code that decompresses the rest of the kernel and jumps there.
So there's no straightforward way, and nobody ever spent the time to implement recompression (at least as far as I know) as it's simple enough to recompile.
In conclusion, you'll have to use
From the Wikipedia article on vmlinux :
So depending on which architecture you are running on, and which Linux version, the answer will vary.
The best way is to let the kernel build process compress it for you.