What is your maximum texture size ? 4096*4096 is quite a lot.
Check it on your hardware with :
glGetIntegerv(GL_MAX_TEXTURE_SIZE, &value); //Returns 1 value
Then if your aim is to save texture memory on modern hardware, indeed you will have to roll out you own fragment shader, as the above posters suggested.
This is a bit involved, but we can help.
I suggest reading first this tutorial, so that you have enough background :